/* ===== JOB JOB — identité "dossier RH / tampon d'entretien" =====
   Palette
   --desk        #2A2521  fond bureau (bois sombre)
   --paper       #F2EAD8  carton manille
   --paper-dark  #E4D8BC  carton manille ombré
   --ink         #211C16  encre
   --stamp-red   #C1392B  refusé
   --stamp-green #3D7A4F  embauché
   --sticky      #F2C94E  post-it
   --clip-blue   #3E6B8A  trombone
*/

@import url('https://fonts.googleapis.com/css2?family=Anton&family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root{
  --desk:#2A2521;
  --desk-2:#332C26;
  --paper:#F2EAD8;
  --paper-dark:#E4D8BC;
  --ink:#211C16;
  --ink-soft:#4A4136;
  --stamp-red:#C1392B;
  --stamp-green:#3D7A4F;
  --sticky:#F2C94E;
  --clip-blue:#3E6B8A;
  --radius:6px;
  --shadow-card: 0 6px 0 rgba(0,0,0,0.18), 0 14px 24px rgba(0,0,0,0.35);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.03), transparent 40%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 6px),
    var(--desk);
  color:var(--paper);
  font-family:'IBM Plex Sans', sans-serif;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.wrap{
  width:100%;
  max-width:1100px;
  padding:24px 20px 60px;
}
.wrap.narrow{max-width:520px;}

h1,h2,h3{
  font-family:'Anton', sans-serif;
  font-weight:400;
  letter-spacing:0.5px;
  text-transform:uppercase;
  margin:0 0 8px;
}
h1{font-size:clamp(28px,5vw,52px); color:var(--paper);}
h2{font-size:clamp(20px,3.4vw,30px); color:var(--paper);}
h3{font-size:18px; color:var(--ink);}

.eyebrow{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  letter-spacing:2px;
  text-transform:uppercase;
  color:var(--sticky);
  margin-bottom:6px;
}

.subtitle{
  font-family:'IBM Plex Mono', monospace;
  color:#c9bfa9;
  font-size:14px;
  margin-bottom:24px;
}

/* ---- Cartes papier ---- */
.card{
  background:var(--paper);
  color:var(--ink);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:var(--shadow-card);
  position:relative;
  border:1px solid rgba(0,0,0,0.08);
}
.card::before{
  content:"";
  position:absolute; top:0; left:24px; right:24px; height:14px;
  background:repeating-linear-gradient(90deg, rgba(0,0,0,0.10) 0 2px, transparent 2px 14px);
  opacity:0.5;
}
.card + .card{margin-top:18px;}

.folder-tab{
  position:absolute; top:-14px; left:22px;
  background:var(--sticky);
  color:var(--ink);
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  padding:4px 10px;
  border-radius:3px;
  transform:rotate(-2deg);
  box-shadow:0 3px 6px rgba(0,0,0,0.3);
}

/* ---- Boutons ---- */
button{
  font-family:'IBM Plex Sans', sans-serif;
  font-weight:600;
  cursor:pointer;
  border:none;
  border-radius:4px;
  padding:13px 22px;
  font-size:15px;
  transition:transform .08s ease, box-shadow .08s ease;
}
button:active{transform:translateY(2px);}
button:disabled{opacity:0.4; cursor:not-allowed;}

.btn-primary{
  background:var(--stamp-green);
  color:#fff;
  box-shadow:0 4px 0 #274f34;
}
.btn-primary:hover:not(:disabled){filter:brightness(1.06);}
.btn-primary:active:not(:disabled){box-shadow:0 1px 0 #274f34;}

.btn-secondary{
  background:transparent;
  color:var(--paper);
  border:2px solid var(--paper);
}
.btn-secondary:hover{background:rgba(242,234,216,0.08);}

.btn-danger{
  background:var(--stamp-red);
  color:#fff;
  box-shadow:0 4px 0 #7d271e;
}

.btn-ghost{
  background:var(--paper-dark);
  color:var(--ink);
  box-shadow:0 3px 0 rgba(0,0,0,0.15);
}

/* ---- Formulaires ---- */
input[type=text], textarea{
  font-family:'IBM Plex Mono', monospace;
  font-size:16px;
  padding:12px 14px;
  border:2px solid var(--ink);
  border-radius:4px;
  background:#fffdf8;
  color:var(--ink);
  width:100%;
}
input[type=text]:focus, textarea:focus{outline:3px solid var(--clip-blue); outline-offset:1px;}
label{
  display:block;
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--ink-soft);
  margin-bottom:6px;
}

/* ---- Code de salle ---- */
.room-code{
  font-family:'Anton', sans-serif;
  font-size:clamp(48px,10vw,96px);
  letter-spacing:10px;
  color:var(--sticky);
  text-align:center;
  text-shadow:0 4px 0 rgba(0,0,0,0.4);
}

/* ---- Badges employé (liste joueurs) ---- */
.player-grid{
  display:flex; flex-wrap:wrap; gap:12px; margin-top:16px;
}
.badge{
  background:var(--paper);
  color:var(--ink);
  border-radius:4px;
  padding:10px 14px;
  display:flex; align-items:center; gap:10px;
  box-shadow:0 3px 0 rgba(0,0,0,0.25);
  font-family:'IBM Plex Mono', monospace;
  border-left:6px solid var(--clip-blue);
}
.badge .dot{
  width:10px;height:10px;border-radius:50%;
  background:var(--stamp-green);
  flex:none;
}
.badge .score{
  margin-left:auto;
  font-weight:700;
  color:var(--ink-soft);
}

/* ---- Chips "ransom note" pour la banque de mots ---- */
.word-bank{
  display:flex; flex-wrap:wrap; gap:8px;
  padding:16px;
  background:var(--paper-dark);
  border-radius:4px;
  margin:14px 0;
  min-height:60px;
}
.chip{
  background:#fffdf8;
  border:1.5px solid var(--ink);
  padding:6px 12px;
  border-radius:3px;
  font-family:'IBM Plex Mono', monospace;
  font-weight:600;
  font-size:15px;
  cursor:pointer;
  box-shadow:0 2px 0 rgba(0,0,0,0.25);
  user-select:none;
}
.chip:nth-child(3n){transform:rotate(-2deg);}
.chip:nth-child(3n+1){transform:rotate(1.5deg);}
.chip:nth-child(3n+2){transform:rotate(-0.5deg);}
.chip:hover{background:var(--sticky);}
.chip:active{transform:scale(0.94);}

.chip.used{
  opacity:0.3;
  pointer-events:none;
  filter:grayscale(1);
}
.word-bank.punct{
  background:transparent;
  padding:0;
  margin-top:-6px;
  min-height:0;
}
.punct-chip{background:var(--sticky);}

.compose-box{
  min-height:70px;
  background:#fffdf8;
  border:2px dashed var(--ink);
  border-radius:4px;
  padding:10px;
  font-family:'IBM Plex Mono', monospace;
  font-size:17px;
  color:var(--ink);
  line-height:1.5;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-content:flex-start;
}
.compose-box.active{border-color:var(--clip-blue); border-style:solid;}
.compose-box.empty::before{
  content:attr(data-placeholder);
  color:#9a8f7a;
  font-size:14px;
}
.token{
  background:var(--paper-dark);
  border:1px solid rgba(0,0,0,0.25);
  border-radius:3px;
  padding:3px 8px;
  cursor:pointer;
  user-select:none;
}
.token:hover{background:var(--stamp-red); color:#fff;}
.token.punct{background:var(--sticky);}

/* ---- Matchup / vote ---- */
.matchup{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:16px;
  align-items:stretch;
  margin:20px 0;
}
.matchup .vs{
  font-family:'Anton', sans-serif;
  color:var(--sticky);
  font-size:28px;
  align-self:center;
}
.answer-card{
  background:var(--paper);
  color:var(--ink);
  border-radius:6px;
  padding:20px;
  font-family:'IBM Plex Mono', monospace;
  font-size:17px;
  box-shadow:var(--shadow-card);
  cursor:pointer;
  border:3px solid transparent;
  position:relative;
}
.matchup.trio{grid-template-columns:1fr auto 1fr auto 1fr;}
.answer-card:hover{border-color:var(--clip-blue);}
.answer-card.selected{border-color:var(--stamp-green);}
.answer-card.disabled{cursor:default;}
.answer-card.disabled:hover{border-color:transparent;}
.answer-card.mine{border-color:var(--clip-blue); border-style:dashed;}
.answer-card.win{border-color:var(--stamp-green);}
.answer-card.lose{opacity:0.72;}
.answer-card .answer-text{font-size:inherit;}
.answer-card .author{
  margin-top:10px;
  font-size:13px;
  color:var(--ink-soft);
  font-weight:600;
}
.answer-card .gain{
  margin-top:4px;
  font-family:'Anton',sans-serif;
  letter-spacing:1px;
  color:var(--stamp-green);
}
.answer-card .ribbon{
  position:absolute; top:8px; left:-8px;
  background:var(--sticky); color:var(--ink);
  font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:700;
  letter-spacing:1px; padding:3px 8px;
  transform:rotate(-4deg);
  box-shadow:0 2px 4px rgba(0,0,0,0.3);
}
.answer-card .card-head{
  display:flex; align-items:center; gap:8px; margin-bottom:8px;
}
.answer-card .letter{
  font-family:'Anton',sans-serif;
  background:var(--ink); color:var(--paper);
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:15px;
}
.answer-card .tag{
  font-family:'IBM Plex Mono',monospace;
  font-size:10px; letter-spacing:1px;
  background:var(--clip-blue); color:#fff;
  padding:3px 7px; border-radius:3px;
}
.answer-card .tag.vote{background:var(--stamp-green);}
.answer-card .result-line{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px;
}

/* Liste de duel côté téléphone : les réponses restent visibles pour tout le
   monde, auteurs compris. */
.duel-list{display:flex; flex-direction:column; gap:14px; margin-top:14px;}
.duel-list .answer-card{font-size:16px;}

/* ---- Mini classement (téléphone) ---- */
.mini-board{
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(242,234,216,0.15);
  border-radius:6px;
  padding:10px 12px;
  text-align:left;
}
.mini-title{
  font-family:'IBM Plex Mono',monospace;
  font-size:11px; letter-spacing:2px; text-transform:uppercase;
  color:var(--sticky); margin-bottom:6px;
}
.mini-row{
  display:flex; align-items:center; gap:10px;
  font-family:'IBM Plex Mono',monospace;
  font-size:14px; color:#d8cdb6;
  padding:3px 0;
}
.mini-row.me{color:var(--sticky); font-weight:700;}
.mini-row .nm{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.mini-row .rank{opacity:0.6; width:26px;}
.mini-row .sc{font-weight:700;}

/* ---- Suivi des réponses (écran recruteur) ---- */
.tracker{display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:12px 0;}
.track-chip{
  background:var(--paper-dark);
  color:var(--ink);
  border-radius:20px;
  padding:6px 12px;
  font-family:'IBM Plex Mono',monospace;
  font-size:13px;
  opacity:0.55;
}
.track-chip.done{opacity:1; background:var(--stamp-green); color:#fff;}

.badge .rank{font-weight:700; color:var(--clip-blue);}
.badge .kick{
  background:transparent; color:var(--stamp-red);
  padding:2px 6px; font-size:14px; box-shadow:none; margin-left:6px;
}
.badge .kick:hover{background:var(--stamp-red); color:#fff;}

/* ---- Choix du pack de questions ---- */
.pack-picker{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
  gap:12px;
  margin-top:16px;
}
.pack{
  background:var(--paper-dark);
  color:var(--ink);
  border:2px solid rgba(0,0,0,0.15);
  border-radius:5px;
  padding:12px 14px;
  text-align:left;
  display:flex; flex-direction:column; gap:4px;
  box-shadow:0 3px 0 rgba(0,0,0,0.15);
}
.pack.on{
  background:var(--sticky);
  border-color:var(--ink);
  box-shadow:0 3px 0 rgba(0,0,0,0.35);
}
.pack-name{font-size:16px; font-weight:700;}
.pack-desc{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  font-weight:400;
  color:var(--ink-soft);
  line-height:1.4;
  white-space:normal;
}

/* ---- Fenêtre "questions maison" ---- */
.modal{
  position:fixed; inset:0; z-index:3000;
  background:rgba(0,0,0,0.6);
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  overflow:auto;
}
.modal[hidden]{display:none;}
.modal-card{
  width:100%;
  max-width:560px;
  max-height:90vh;
  overflow:auto;
}
.modal-card textarea{
  font-size:14px;
  min-height:110px;
  resize:vertical;
}

/* ---- Barre d'outils (écran recruteur) ---- */
.topbar{
  position:fixed; top:16px; right:16px; z-index:1000;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  justify-content:flex-end;
}
.music-ctrl{
  display:flex; align-items:center; gap:10px;
  background:var(--paper-dark);
  border-radius:4px;
  padding:0 12px 0 0;
  box-shadow:0 3px 0 rgba(0,0,0,0.15);
}
.music-ctrl .btn-ghost{box-shadow:none;}
/* Sur un écran étroit la barre d'outils passe au-dessus du contenu :
   on décale le début de la page pour qu'elle ne recouvre rien. */
@media (max-width:900px){
  body.host .wrap{padding-top:80px;}
}
.vol-label{
  font-family:'IBM Plex Mono', monospace;
  font-size:12px; font-weight:700;
  color:var(--ink);
  width:38px; text-align:right;
}

/* Curseur de volume — même look "papier/encre" que le reste */
input[type=range]{
  -webkit-appearance:none; appearance:none;
  width:110px; height:6px;
  background:var(--ink-soft);
  border-radius:3px;
  outline:none;
  cursor:pointer;
}
input[type=range]:focus-visible{outline:3px solid var(--clip-blue); outline-offset:3px;}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:18px; height:18px; border-radius:50%;
  background:var(--stamp-green);
  border:2px solid var(--ink);
  cursor:pointer;
}
input[type=range]::-moz-range-thumb{
  width:18px; height:18px; border-radius:50%;
  background:var(--stamp-green);
  border:2px solid var(--ink);
  cursor:pointer;
}

/* ---- Barre de chrono ---- */
.timer-bar{
  position:fixed; top:0; left:0; right:0; height:6px;
  background:rgba(0,0,0,0.35);
  z-index:2000;
}
.timer-bar[hidden]{display:none;}
.timer-fill{
  height:100%; width:100%;
  background:var(--stamp-green);
  transition:width .4s linear;
}
.timer-bar.urgent .timer-fill{background:var(--stamp-red);}
.timer-text{
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:700;
  color:var(--paper);
  background:rgba(0,0,0,0.5);
  padding:2px 10px; border-radius:0 0 6px 6px;
}
.timer-bar.urgent .timer-text{color:#fff; background:var(--stamp-red);}
.vote-count{
  position:absolute; top:-12px; right:-10px;
  background:var(--ink); color:var(--paper);
  border-radius:50%; width:32px; height:32px;
  display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Mono', monospace; font-weight:700; font-size:14px;
}

/* ---- Tampon ---- */
.stamp{
  font-family:'Anton', sans-serif;
  font-size:clamp(28px,6vw,54px);
  letter-spacing:3px;
  text-transform:uppercase;
  border:6px solid currentColor;
  border-radius:8px;
  padding:8px 22px;
  display:inline-block;
  transform:rotate(-8deg) scale(0);
  animation:stampIn .35s cubic-bezier(.2,1.3,.4,1) forwards;
}
.stamp.small{
  font-size:clamp(16px,2.4vw,22px);
  border-width:3px;
  padding:2px 10px;
  letter-spacing:2px;
}
.stamp.hired{color:var(--stamp-green);}
.stamp.rejected{color:var(--stamp-red);}
@keyframes stampIn{
  0%{transform:rotate(-8deg) scale(2.4); opacity:0;}
  60%{transform:rotate(-8deg) scale(0.92); opacity:1;}
  100%{transform:rotate(-8deg) scale(1); opacity:1;}
}

.center{text-align:center;}
.row{display:flex; gap:12px; flex-wrap:wrap; align-items:center;}
.row.between{justify-content:space-between;}
.mt{margin-top:20px;}
.mt-sm{margin-top:10px;}
.muted{color:var(--ink-soft); font-family:'IBM Plex Mono', monospace; font-size:13px;}
.muted-light{color:#b9ae97; font-family:'IBM Plex Mono', monospace; font-size:13px;}

.waiting{
  text-align:center;
  padding:40px 20px;
}
.waiting .pulse{
  width:14px;height:14px;border-radius:50%;
  background:var(--sticky);
  display:inline-block;
  animation:pulse 1s infinite ease-in-out;
  margin:0 3px;
}
.waiting .pulse:nth-child(2){animation-delay:.15s;}
.waiting .pulse:nth-child(3){animation-delay:.3s;}
@keyframes pulse{0%,100%{opacity:.3; transform:scale(.8);} 50%{opacity:1; transform:scale(1.15);}}

.podium{
  display:flex; align-items:flex-end; justify-content:center; gap:16px; margin-top:30px;
}
.podium .step{
  background:var(--paper); color:var(--ink);
  border-radius:6px 6px 0 0;
  padding:16px 14px;
  text-align:center;
  font-family:'IBM Plex Mono', monospace;
  box-shadow:var(--shadow-card);
  width:140px;
}
.podium .step h3{margin-bottom:4px;}
.podium .step.p1{height:200px; order:2; background:var(--sticky);}
.podium .step.p2{height:160px; order:1;}
.podium .step.p3{height:130px; order:3;}

footer.hint{
  margin-top:40px;
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  color:#8b8171;
  text-align:center;
}

@media (max-width:640px){
  .matchup, .matchup.trio{grid-template-columns:1fr; }
  .matchup .vs{display:none;}
  .wrap{padding:20px 14px 80px;}
  .card{padding:20px 16px;}
  .chip{font-size:16px; padding:8px 13px;}   /* cibles tactiles plus larges */
  .token{padding:5px 9px;}
  button{padding:14px 20px;}
}
