/* ============================================================
   PTF 2027 — v0.5
   ------------------------------------------------------------
   Surcouche d'interface uniquement (ne modifie ni pc.js, ni
   pc.css, ni style.css). Fonctionne avec ptf-2027.js (v0.5).
   ============================================================ */

:root{
  --ptf-ink:#2d241c;
  --ptf-brown:#5b3a24;
  --ptf-gold:#b88635;
  --ptf-paper:rgba(255,250,237,.96);
  --ptf-paper-soft:rgba(255,249,231,.62);
  --ptf-line:rgba(91,58,36,.18);
  --ptf-shadow:0 3px 12px rgba(45,30,18,.10);
  --ptf-strong:0 5px 18px rgba(45,30,18,.15);
}

body.pc{
  color:var(--ptf-ink);
  font-family:"Segoe UI","Helvetica Neue",Arial,sans-serif;
  font-size:15px;
}

/* ---------- Deux colonnes : Fiche (.right) à gauche, Combat (.left) à droite ---------- */
body.pc main{
  box-sizing:border-box;
  display:flex;
  gap:14px;
  padding:12px 14px 18px;
  height:calc(100vh - 58px);
  margin-top:58px;
  overflow:hidden;
}
body.pc main>.right{ order:1; }
body.pc main>.left{ order:2; }
body.pc main>.left,body.pc main>.right{
  box-sizing:border-box;
  width:50%;
  float:none;
  padding:0 5px 35px;
  overflow-x:hidden;
  overflow-y:auto;
}

/* ---------- Cartes ---------- */
body.pc .card{
  box-sizing:border-box;
  margin:0 0 11px;
  padding:0;
  background:var(--ptf-paper);
  border:1px solid var(--ptf-line);
  border-radius:9px;
  box-shadow:var(--ptf-shadow);
  overflow:hidden;
}
body.pc .card>h2,body.pc .card>h3{
  box-sizing:border-box;
  margin:0;
  padding:8px 13px;
  border-bottom:1px solid rgba(91,58,36,.12);
  background:rgba(120,82,42,.045);
  text-align:left;
  font-size:17px;
  line-height:1.25;
}
body.pc .card>.in{ box-sizing:border-box; padding:13px 15px; }
body.pc hr{ display:none!important; }

/* ---------- En-tête : titre compact + résumé du personnage + boutons ---------- */
body.pc>header{
  height:58px;
  min-height:58px;
  box-sizing:border-box;
  z-index:10000;
  display:flex;
  align-items:center;
  gap:18px;
  padding:0 18px;
  background:linear-gradient(180deg,#2b1f16,#1e1813);
  border-bottom:2px solid #a87932;
  box-shadow:0 2px 10px rgba(0,0,0,.22);
}
body.pc>header h1{
  flex:0 0 auto;
  margin:0;
  padding:0;
  float:none;
  font-size:14px;
  line-height:1.1;
  color:#e7c778;
  opacity:.8;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:150px;
  text-shadow:0 1px 1px #000;
}
#ptf-header-identity{
  order:2;
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:baseline;
  gap:10px;
  overflow:hidden;
}
#ptf-header-identity .ptf-hi-name{
  font-family:"PT Serif",Georgia,serif;
  font-size:18px;
  font-weight:700;
  color:#f3e2b8;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#ptf-header-identity .ptf-hi-meta{
  font-size:12px;
  color:#c9ad7a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.pc header .character-controls{
  position:static;
  top:auto; left:auto;
  order:3;
  margin-left:auto;
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
body.pc header .character-controls button{
  min-height:34px;
  padding:6px 11px;
  border:1px solid #b88a3d;
  border-radius:6px;
  background:rgba(255,250,235,.08);
  color:#f7e4b1;
  font-size:12px;
  cursor:pointer;
  white-space:nowrap;
}
body.pc header .character-controls button:hover{ background:rgba(255,250,235,.16); }

/* ---------- Carte d'identité ---------- */
body.pc main>.right>.card:first-child{ min-height:235px; box-shadow:var(--ptf-strong); }
body.pc main>.right>.card:first-child>.in{ padding:15px 205px 16px 17px; }
body.pc #name{ width:min(100%,300px); box-sizing:border-box; padding:8px 11px; font-size:20px; font-weight:600; }
body.pc #level{ width:58px!important; max-width:58px!important; text-align:center; }
body.pc #gender{ width:105px; }
body.pc #kind{ width:145px; }
body.pc #type{ width:210px; }
body.pc #age{ width:75px; }
body.pc #height,body.pc #weight{ width:95px; }
body.pc #description{ width:100%; }

body.pc .character-img{
  position:absolute!important;
  top:15px; right:15px;
  width:175px!important; height:175px!important;
  margin:0!important; padding:0!important;
}
body.pc .character-img img,body.pc #character-avatar{
  width:175px!important; height:175px!important;
  object-fit:cover;
  border:2px solid rgba(91,58,36,.55);
  border-radius:8px;
  box-shadow:0 3px 10px rgba(45,30,18,.16);
}

body.pc input:not([type=checkbox]):not([type=radio]),body.pc select,body.pc textarea{
  box-sizing:border-box;
  border:1px solid rgba(91,58,36,.22);
  border-radius:6px;
  background:rgba(255,252,242,.82);
  color:var(--ptf-ink);
}

/* ---------- Attributs + bandeau "état du personnage" ---------- */
body.pc .ptf-attributes-card{ box-shadow:var(--ptf-strong)!important; }
body.pc .ptf-attributes-card>h3{ font-size:19px; padding:9px 14px; }

.ptf-vitals-bar{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:2px 0 14px;
  padding:10px 12px;
  background:rgba(120,82,42,.06);
  border:1px solid rgba(91,58,36,.14);
  border-radius:7px;
}
.ptf-vital{ text-align:center; }
.ptf-vital-label{ display:block; font-size:11px; color:#7a6248; white-space:nowrap; }
.ptf-vital-value{ display:block; font-size:17px; font-weight:700; color:var(--ptf-brown); }

/* ---------- Paires de cartes : Armes+Protections, Talents+Sorts ---------- */
.ptf-pair-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:11px;
  margin:0 0 11px;
}
.ptf-pair-grid>.card{ margin-bottom:0; min-width:0; }

body.pc .ptf-important-card>h3{ font-size:15px; padding:8px 11px; }
body.pc .ptf-important-card>.in{ padding:9px 11px; }

/* ---------- Rubriques secondaires repliables + badge de comptage ---------- */
body.pc .ptf-secondary-card{ background:var(--ptf-paper-soft); box-shadow:none; }
body.pc .ptf-secondary-card>h3{
  position:relative;
  min-height:35px;
  box-sizing:border-box;
  padding:8px 38px 8px 12px;
  cursor:pointer;
  user-select:none;
  font-size:14px;
}
body.pc .ptf-secondary-card>h2{
  position:relative;
  cursor:pointer;
  user-select:none;
  padding-right:38px!important;
}
body.pc .ptf-secondary-card>h3:after,
body.pc .ptf-secondary-card>h2:after{
  content:"▸";
  position:absolute;
  right:13px; top:50%;
  transform:translateY(-50%);
  opacity:.65;
}
body.pc .ptf-secondary-card.ptf-open>h3:after,
body.pc .ptf-secondary-card.ptf-open>h2:after{ content:"▾"; }
body.pc .ptf-secondary-card.ptf-collapsed>.in{ display:none; }

.ptf-count-badge{
  position:absolute;
  right:34px; top:50%;
  transform:translateY(-50%);
  font-size:11px; font-weight:400;
  color:#8a7357;
  background:rgba(91,58,36,.08);
  padding:2px 7px;
  border-radius:10px;
  white-space:nowrap;
}

body.pc .garou-panel{ box-shadow:none; background:rgba(255,249,231,.70); }

/* ---------- Combat, mis en avant ---------- */
body.pc #combat{ border:2px solid rgba(91,58,36,.28); box-shadow:var(--ptf-strong); }
body.pc #combat>.in{ padding:14px 16px; }
body.pc #combat .in>a.roll{ width:190px; height:70px; margin:12px auto 8px; }
body.pc #comres{ margin-top:0; border-top:1px solid rgba(91,58,36,.10); background:rgba(255,251,239,.94); }

/* Adversaires : chaque entrée devient une carte compacte au lieu d'une liste brute */
#mr-lists ul{
  background:rgba(255,255,255,.55);
  border:1px solid rgba(91,58,36,.16);
  border-radius:8px;
  padding:8px 10px;
  margin-bottom:8px;
}
#mr-lists ul.mr-dead{ opacity:.55; }

body.pc #sr{ border:1px solid rgba(91,58,36,.20); box-shadow:var(--ptf-shadow); }
body.pc #sr>h2{ font-size:18px; color:#496047; }

/* ---------- Outils de dés : compacts, toujours visibles, dans la colonne Combat ---------- */
body.pc #ptf-dice-tools{
  margin:11px 0 0;
  padding:0;
  border:1px solid rgba(91,58,36,.17);
  border-radius:8px;
  background:rgba(255,249,231,.66);
  box-shadow:none;
  overflow:hidden;
}
body.pc #ptf-dice-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:38px;
  box-sizing:border-box;
  padding:8px 13px;
  cursor:pointer;
  user-select:none;
  font-weight:700;
  font-size:14px;
  color:var(--ptf-brown);
}
body.pc #ptf-dice-header:after{ content:"▾ replier"; font-size:11px; font-weight:400; opacity:.65; }
body.pc #ptf-dice-tools:not(.ptf-dice-open) #ptf-dice-header:after{ content:"▸ déplier"; }
body.pc #ptf-dice-body{ display:none; padding:0 9px 9px; }
body.pc #ptf-dice-tools.ptf-dice-open #ptf-dice-body{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
body.pc #ptf-dice-body>.card{
  min-width:0; margin:0;
  border:1px solid rgba(91,58,36,.13);
  border-radius:7px;
  box-shadow:none;
}
body.pc #ptf-dice-body>.card>h2{ padding:6px 8px; font-size:13px; text-align:center; }
body.pc #ptf-dice-body>.card>.in{ padding:7px 8px; text-align:center; }

/* ---------- Petits écrans ---------- */
@media screen and (max-width:900px){
  body.pc main{ display:block; height:auto; min-height:calc(100vh - 58px); overflow:visible; }
  body.pc main>.left,body.pc main>.right{ width:100%; height:auto; overflow:visible; }
  body.pc main>.right>.card:first-child>.in{ padding-right:15px; }
  body.pc .character-img{ position:relative!important; top:auto; right:auto; margin:10px auto!important; }
  #ptf-header-identity{ display:none; }
  body.pc>header h1{ max-width:none; opacity:1; font-size:14px; }
  .ptf-vitals-bar{ grid-template-columns:repeat(2,1fr); }
  .ptf-pair-grid{ grid-template-columns:1fr; }
  body.pc #ptf-dice-tools.ptf-dice-open #ptf-dice-body{ grid-template-columns:1fr; }
}
