/* ── PMU Tour Tracker ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;500&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --pmu-zinc:       #252018;
  --pmu-zinc-mid:   #3a3328;
  --pmu-gold:       #c9960f;
  --pmu-gold-lt:    #e5b81a;
  --pmu-cream:      #f5eedc;
  --pmu-cream-dk:   #e6dcca;
  --pmu-red:        #b83225;
  --pmu-blue:       #1a4a8a;
  --pmu-green:      #2a7a3b;
  --pmu-text:       #1a1510;
  --pmu-muted:      #7a7060;
  --pmu-radius:     6px;
}

#pmu-tracker-root * { box-sizing: border-box; margin: 0; padding: 0; }

.pmu-app {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--pmu-cream);
  color: var(--pmu-text);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d4caaa;
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
.pmu-header {
  background: var(--pmu-zinc);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.pmu-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  color: var(--pmu-gold-lt);
  letter-spacing: 2px;
  line-height: 1;
}
.pmu-header-sub {
  font-size: 11px;
  color: #888;
  letter-spacing: 1px;
  flex: 1;
}
.pmu-header-date {
  font-size: 11px;
  color: #666;
  font-style: italic;
}

/* Ticker */
.pmu-ticker-bar {
  background: var(--pmu-red);
  padding: 5px 1.25rem;
  font-size: 11px;
  color: #fff;
  letter-spacing: 1.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabs */
.pmu-tabs {
  display: flex;
  background: var(--pmu-zinc-mid);
  gap: 0;
}
.pmu-tab {
  flex: 1;
  padding: 10px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 3px solid transparent;
}
.pmu-tab:hover { color: var(--pmu-gold-lt); }
.pmu-tab.active {
  color: var(--pmu-gold-lt);
  border-bottom-color: var(--pmu-gold-lt);
  background: rgba(255,255,255,0.04);
}

/* Join bar */
.pmu-join-bar {
  display: flex;
  gap: 8px;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--pmu-cream-dk);
  align-items: center;
}
.pmu-join-bar input[type="text"] {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid #c8bfa8;
  background: #fff;
  border-radius: var(--pmu-radius);
  flex: 1;
  max-width: 240px;
  color: var(--pmu-text);
}
.pmu-join-bar input:focus { outline: none; border-color: var(--pmu-gold); }
.pmu-join-btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  background: var(--pmu-zinc);
  color: var(--pmu-gold-lt);
  border: none;
  padding: 8px 18px;
  border-radius: var(--pmu-radius);
  cursor: pointer;
  white-space: nowrap;
}
.pmu-join-btn:hover { background: var(--pmu-zinc-mid); }

/* Section label */
.pmu-section-lbl {
  padding: 6px 1.25rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aaa;
  background: var(--pmu-cream-dk);
  border-bottom: 1px solid #d8d0bc;
}

/* ── Player cards (NOUVEAU LAYOUT VERTICAL) ──────── */
#pmu-players {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pmu-pcard {
  background: #fff;
  border: 1px solid var(--pmu-cream-dk);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.pmu-pcard-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(to bottom, #fcf8e8, #f6efd8);
  border-bottom: 1px solid var(--pmu-cream-dk);
}

.pmu-pcard-ava {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fef3d3;
  border: 2px solid var(--pmu-gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  color: var(--pmu-gold);
  flex-shrink: 0;
  line-height: 1;
}

.pmu-pcard-meta {
  flex: 1;
  min-width: 0;
}
.pmu-pcard-name {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--pmu-zinc);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pmu-pcard-sub {
  font-size: 11px;
  color: var(--pmu-muted);
  margin-top: 2px;
  font-style: italic;
}

.pmu-pcard-total {
  text-align: right;
  flex-shrink: 0;
  line-height: 1;
}
.pmu-pcard-bigL {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--pmu-gold);
  line-height: 1;
  display: block;
}
.pmu-pcard-bigLsub {
  font-size: 9px;
  color: var(--pmu-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Lignes boissons (Demi / Pinte / Ricard) */
.pmu-dline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pmu-cream-dk);
}
.pmu-dline:last-of-type { border-bottom: none; }

.pmu-dline-ico {
  font-size: 20px;
  flex-shrink: 0;
  width: 26px;
  text-align: center;
}

.pmu-dline-meta {
  flex: 1;
  min-width: 0;
}
.pmu-dline-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pmu-muted);
  font-weight: 500;
}
.pmu-dline-sub {
  font-size: 10px;
  color: #bbb;
  margin-top: 1px;
}

.pmu-dline-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pmu-dline-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  line-height: 1;
  min-width: 36px;
  text-align: center;
}
.pmu-dline-num.demi   { color: var(--pmu-gold); }
.pmu-dline-num.beer   { color: var(--pmu-gold); }
.pmu-dline-num.canouche { color: var(--pmu-gold); }
.pmu-dline-num.ricard { color: var(--pmu-blue); }

.pmu-pcard-foot {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px;
  background: #faf5e8;
}
.pmu-pcard-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pmu-muted);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  letter-spacing: .5px;
  transition: color .12s;
}
.pmu-pcard-del:hover { color: var(--pmu-red); }

/* Boutons +/- (partagés entre tournée et popup) */
.pmu-btn-plus {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  padding-bottom: 1px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.pmu-btn-plus.demi,
.pmu-btn-plus.beer,
.pmu-btn-plus.canouche { border-color: var(--pmu-gold); color: var(--pmu-gold); }
.pmu-btn-plus.demi:active, .pmu-btn-plus.demi:hover,
.pmu-btn-plus.beer:active, .pmu-btn-plus.beer:hover,
.pmu-btn-plus.canouche:active, .pmu-btn-plus.canouche:hover { background: var(--pmu-gold); color: #fff; }
.pmu-btn-plus.ricard { border-color: var(--pmu-blue); color: var(--pmu-blue); }
.pmu-btn-plus.ricard:active, .pmu-btn-plus.ricard:hover { background: var(--pmu-blue); color: #fff; }

.pmu-btn-minus {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: #bbb;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.pmu-btn-minus:hover, .pmu-btn-minus:active { border-color: var(--pmu-red); color: var(--pmu-red); }

/* Totals bar — 3 colonnes : bière (litres) / ricard (cl) / total (L) */
.pmu-totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--pmu-zinc);
  padding: 0.9rem 1.25rem;
  gap: 8px;
  margin-top: 0;
}
.pmu-total-item { text-align: center; }
.pmu-total-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
}
.pmu-total-val.beer   { color: var(--pmu-gold-lt); }
.pmu-total-val.ricard { color: #7aadee; }
.pmu-total-val.all    { color: #fff; }
.pmu-total-lbl {
  font-size: 9px;
  color: #777;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.pmu-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--pmu-muted);
  font-size: 13px;
  font-style: italic;
}

/* ── Carte ──────────────────────────────── */
.pmu-map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--pmu-cream-dk);
  flex-wrap: wrap;
}
.pmu-map-toolbar button {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: var(--pmu-zinc);
  color: var(--pmu-gold-lt);
  border: none;
  padding: 7px 14px;
  border-radius: var(--pmu-radius);
  cursor: pointer;
  letter-spacing: 0.5px;
}
.pmu-map-toolbar button:hover { background: var(--pmu-zinc-mid); }
.pmu-map-toolbar button:disabled { opacity: 0.5; cursor: not-allowed; }
.pmu-bar-count {
  font-size: 11px;
  color: var(--pmu-muted);
}

#pmu-map {
  height: 360px;
  width: 100%;
}

/* Marker custom */
.pmu-marker {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--pmu-zinc);
  border: 2px solid var(--pmu-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s;
  line-height: 1;
}
.pmu-marker.visited {
  background: var(--pmu-green);
  border-color: #5cc46e;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}
.pmu-marker:hover { transform: scale(1.15); }

/* Bar popup panel */
#pmu-bar-panel {
  border-bottom: 1px solid var(--pmu-cream-dk);
}
.pmu-bar-popup {
  padding: 1rem 1.25rem;
  background: #fff;
}
.pmu-bar-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pmu-bar-popup-header strong {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--pmu-zinc);
}
.pmu-close {
  background: none; border: none;
  font-size: 14px; cursor: pointer;
  color: #aaa; padding: 2px 4px;
  line-height: 1;
}
.pmu-close:hover { color: var(--pmu-red); }
.pmu-bar-popup-addr {
  font-size: 11px;
  color: var(--pmu-muted);
  margin-bottom: 10px;
  font-style: italic;
}
.pmu-bar-popup-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--pmu-muted);
  margin-bottom: 10px;
}
.pmu-visited-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 12px;
  color: var(--pmu-zinc);
}
.pmu-visited-label input { cursor: pointer; }
.pmu-bar-players { margin-top: 12px; }
.pmu-bar-players-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aaa;
  margin-bottom: 8px;
}
.pmu-bar-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--pmu-cream-dk);
  flex-wrap: wrap;
}
.pmu-bar-player-name {
  font-family: 'Lora', serif;
  font-size: 14px;
  font-weight: 600;
  flex: 1 1 100%;
  min-width: 80px;
}
.pmu-bar-player-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
}
.pmu-mini-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.pmu-mini-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  min-width: 24px;
  text-align: center;
  line-height: 1;
}
.pmu-mini-count.demi   { color: var(--pmu-gold); }
.pmu-mini-count.beer   { color: var(--pmu-gold); }
.pmu-mini-count.canouche { color: var(--pmu-gold); }
.pmu-mini-count.ricard { color: var(--pmu-blue); }
.pmu-bar-note {
  font-size: 11px;
  color: var(--pmu-muted);
  font-style: italic;
  margin-top: 8px;
}

/* Bar list */
.pmu-bar-list { padding: 0 0 1rem; }
.pmu-list-section {
  padding: 6px 1.25rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aaa;
  background: var(--pmu-cream-dk);
  border-top: 1px solid #d8d0bc;
  border-bottom: 1px solid #d8d0bc;
}
.pmu-bar-item {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 8px 1.25rem;
  border-bottom: 1px solid var(--pmu-cream-dk);
  cursor: pointer;
  transition: background 0.1s;
}
.pmu-bar-item:hover { background: #ece7d5; }
.pmu-bar-item.visited { opacity: 0.75; }
.pmu-bar-item-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--pmu-gold);
  text-align: center;
  line-height: 1;
}
.pmu-bar-item-name {
  font-family: 'Lora', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--pmu-zinc);
}
.pmu-bar-item-addr {
  font-size: 11px;
  color: var(--pmu-muted);
  font-style: italic;
}
.pmu-bar-item-conso {
  font-size: 11px;
  color: var(--pmu-muted);
  margin-top: 2px;
}
.pmu-bar-item-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: transparent;
  transition: all 0.15s;
}
.pmu-bar-item-check.checked {
  background: var(--pmu-green);
  border-color: var(--pmu-green);
  color: #fff;
}

/* ── Recherche de bar (NOUVEAU) ─────────── */
.pmu-search-wrap {
  position: relative;
  border-bottom: 1px solid var(--pmu-cream-dk);
  background: #fff;
}
.pmu-search-row {
  display: flex;
  align-items: center;
  padding: 10px 1.25rem;
  gap: 10px;
}
.pmu-search-icon { font-size: 14px; opacity: 0.5; flex-shrink: 0; }
.pmu-search-wrap input {
  flex: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--pmu-text);
  min-width: 0;
}
.pmu-search-wrap input::placeholder { color: #c0b898; }
.pmu-search-clear {
  background: none; border: none; cursor: pointer;
  color: #ccc; font-size: 13px;
  padding: 4px 6px; border-radius: 50%;
  line-height: 1; flex-shrink: 0;
}
.pmu-search-clear:hover { color: var(--pmu-red); }

.pmu-search-results {
  border-top: 1px solid var(--pmu-cream-dk);
  background: #fff;
  max-height: 280px;
  overflow-y: auto;
}
.pmu-search-loading,
.pmu-search-empty {
  padding: 12px 1.25rem;
  font-size: 12px;
  color: var(--pmu-muted);
  font-style: italic;
}
.pmu-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 1.25rem;
  border-top: 1px solid var(--pmu-cream-dk);
}
.pmu-search-item:first-child { border-top: none; }
.pmu-search-item:hover { background: #faf5e8; }
.pmu-search-item-info { flex: 1; min-width: 0; }
.pmu-search-item-name {
  font-family: 'Lora', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--pmu-zinc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pmu-search-item-addr {
  font-size: 11px;
  color: var(--pmu-muted);
  font-style: italic;
  margin-top: 1px;
}
.pmu-search-add {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: #fef3d3;
  color: var(--pmu-gold);
  border: 1.5px solid var(--pmu-gold);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.pmu-search-add:hover { background: var(--pmu-gold); color: #fff; }
.pmu-search-add:disabled { opacity: 0.5; cursor: not-allowed; }
.pmu-search-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pmu-search-badge.on {
  background: #eaf6ec;
  color: var(--pmu-green);
  border: 1px solid #b0ddb8;
}

/* Responsive */
@media (max-width: 540px) {
  .pmu-app { border-radius: 0; border-left: none; border-right: none; }
  .pmu-header { padding: 0.7rem 1rem; gap: .6rem; flex-wrap: wrap; }
  .pmu-title { font-size: 24px; letter-spacing: 1.5px; }
  .pmu-header-sub { display: none; }
  .pmu-header-date { font-size: 10px; }
  .pmu-tab { font-size: 12px; padding: 9px 0; }
  .pmu-join-bar { padding: .7rem 1rem; }
  .pmu-join-bar input[type="text"] { font-size: 13px; padding: 7px 10px; max-width: none; }
  .pmu-join-btn { font-size: 14px; padding: 7px 14px; }

  #pmu-players { padding: 8px 8px; gap: 8px; }
  .pmu-pcard-head { padding: 11px 12px; gap: 10px; }
  .pmu-pcard-ava { width: 36px; height: 36px; font-size: 17px; }
  .pmu-pcard-name { font-size: 16px; }
  .pmu-pcard-bigL { font-size: 22px; }
  .pmu-dline { padding: 9px 12px; gap: 10px; }
  .pmu-dline-num { font-size: 28px; min-width: 32px; }
  .pmu-dline-label { font-size: 10px; letter-spacing: 1px; }

  .pmu-totals { padding: .8rem 1rem; }
  .pmu-total-val { font-size: 24px; }

  .pmu-map-toolbar { padding: .6rem .8rem; }
  .pmu-map-toolbar button { font-size: 11px; padding: 6px 12px; }
  .pmu-bar-popup { padding: .8rem 1rem; }
  .pmu-bar-popup-header strong { font-size: 16px; }
  .pmu-bar-popup-stats { gap: 10px; font-size: 11px; }
  .pmu-bar-item { padding: 8px 1rem; gap: 8px; }
  .pmu-bar-item-name { font-size: 13px; }

  .pmu-search-row { padding: 8px 1rem; }
  .pmu-search-wrap input { font-size: 13px; }
  .pmu-search-item { padding: 9px 1rem; }
  .pmu-search-item-name { font-size: 13px; }
}

@media (max-width: 360px) {
  .pmu-dline-num { font-size: 24px; min-width: 28px; }
  .pmu-btn-plus { width: 28px; height: 28px; font-size: 16px; }
  .pmu-btn-minus { width: 24px; height: 24px; font-size: 14px; }
  .pmu-pcard-bigL { font-size: 20px; }
}
