/* Extracted styles from the original Typing Trainer */
:root{
  --panel: rgba(255,255,255,.08);
  --panel2: rgba(0,0,0,.30);
  --shadow: rgba(0,0,0,.40);

  --ok: #4ade80;
  --bad: #f87171;

  --textBoxH: 240px;
  --blockAnimMs: 240ms;
  --fontSize: 32px;
  --lineH: 1.75;
}

*{ box-sizing: border-box; font-family: "Inter", system-ui, sans-serif; }

body{
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg,#0f2027,#203a43,#2c5364);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 24px;
}

.container{
  width: 1180px;
  max-width: 96vw;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 20px 60px var(--shadow);
}

h1{
  text-align: center;
  margin: 0 0 14px 0;
  font-weight: 650;
  letter-spacing: .3px;
}

.top{
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.custom-text{
  width: 100%;
  height: 96px;
  border-radius: 14px;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.row{
  display: grid;
  grid-template-columns: 1fr 240px 240px 240px;
  gap: 10px;
  align-items: center;
}

.hint{
  opacity: .9;
  font-size: 13px;
  line-height: 1.2;
}

button{
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
button:hover{ opacity: .92; }
button:active{ transform: scale(.99); }

.btn-primary{ background: var(--ok); color: #064e3b; }
.btn-secondary{ background: rgba(255,255,255,.14); color: #fff; }
.btn-danger{ background: rgba(248,113,113,.18); color: #fff; }
button:disabled{ opacity: .45; cursor: not-allowed; }

/* Zone texte affiché */
.text-box{
  background: var(--panel2);
  border-radius: 14px;
  padding: 18px;
  height: var(--textBoxH);
  overflow: hidden;
  position: relative;
  user-select: none;
  margin-bottom: 14px;
  cursor: text;
}

.stack-outer{
  position: absolute;
  inset: 18px;
  will-change: transform;
  transform: translateY(0px);
  transition: transform var(--blockAnimMs) ease-out;
}

.stack-inner{
  will-change: transform;
  transform: translateY(0px);
  transition: none; /* anti jitter */
}

.block{
  white-space: pre-wrap;
  font-size: var(--fontSize);
  line-height: var(--lineH);
  padding-right: 8px;
  padding-bottom: 18px;
}

.word{ display:inline-block; white-space: nowrap; }
.char{ display:inline-block; }
.ws{ display:inline-block; white-space: pre; }

.correct{ color: var(--ok); }
.incorrect{ color: var(--bad); text-decoration: underline; }

.current{
  border-left: 2px solid rgba(255,255,255,.95);
  animation: blink 1s infinite;
  margin-left: -1px;
}
@keyframes blink{ 50%{ border-color: transparent; } }

.stats{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}

.pill{
  background: rgba(255,255,255,.10);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.pill b{ font-weight: 800; }

.history{
  margin-top: 16px;
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 14px;
}
.history-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.history-header h2{
  margin:0;
  font-size: 16px;
  opacity:.95;
  font-weight: 750;
}
table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
  opacity: .95;
}
th, td{
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  white-space: nowrap;
}
th{ opacity:.9; font-weight: 750; }
tr:last-child td{ border-bottom: none; }

.footer{
  margin-top: 10px;
  opacity: .7;
  font-size: 12px;
  text-align: center;
}

/* Input invisible */
#ghostInput{
  position: fixed;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

@media (max-width: 980px){
  .row{ grid-template-columns: 1fr; }
  .stats{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  :root{ --textBoxH: 160px; }
  th, td{ white-space: normal; }
}

/* =========================
   UX UPGRADES
   ========================= */

.toolbar{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  margin: 10px 0 14px;
}
.toolbar-left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.toolbar-right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.chip{
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.kbd-hint{
  opacity: .75;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Focus clair sur la zone de texte */
.text-box.is-focused{
  outline: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 0 0 6px rgba(255,255,255,.06);
}

/* Progress bar */
.progress{
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  pointer-events: none;
  margin: 10px 18px 12px; /* bien centré entre la zone et l’astuce */
}

.progress-bar{
  height:100%;
  width:0%;
  background: rgba(74,222,128,.90);
  transition: width 120ms ease;
}
.progress-label{
  position:absolute;
  right: 0;
  top: -18px;
  font-size: 12px;
  opacity: .8;
}

/* Toasts */
.toast-host{
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 9999;
}
.toast{
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  max-width: 340px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  animation: toast-in 160ms ease-out;
}
.toast.ok{ border-color: rgba(74,222,128,.35); }
.toast.bad{ border-color: rgba(248,113,113,.35); }
@keyframes toast-in{
  from{ transform: translateY(8px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.modal-card{
  position: relative;
  width: min(520px, 96vw);
  border-radius: 18px;
  background: rgba(20, 28, 34, .92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.modal-head h3{
  margin: 0;
  font-size: 16px;
  font-weight: 850;
}
.icon-btn{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
}
.modal-body{
  padding: 12px 14px;
  display:grid;
  gap: 12px;
}
.row-setting{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
}
.range-wrap{
  display:flex;
  align-items:center;
  gap: 10px;
}
.range-wrap input[type="range"]{ width: 220px; }
.modal-foot{
  display:flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Hide stats option */
body.hide-stats .stats{ display:none; }

/* Reduce motion */
body.reduce-motion *{
  transition: none !important;
  animation: none !important;
}
/* Force le masquage quand l'attribut hidden est présent */
#settingsModal[hidden]{
  display: none !important;
}
/* Empêche la sélection derrière la modal */
body.modal-open{
  overflow: hidden;
}
/* Permet de scroller la zone seulement dans certains états (ex: fin de partie) */
.text-box.scrollable{
  overflow: auto;               /* au lieu de hidden */
  -webkit-overflow-scrolling: touch;
}

/* Quand c'est scrollable, on ne translate plus le contenu */
.text-box.scrollable .stack-outer,
.text-box.scrollable .stack-inner{
  transform: none !important;
}
/* Modal plus large pour l'historique */
.modal-card--wide{
  width: min(980px, 96vw);
}

/* Historique dans modal */
.history-actions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
.history-note{
  opacity:.75;
  font-size: 12px;
}

.history-table-wrap{
  max-height: min(62vh, 520px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.15);
}

.history-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  white-space: nowrap;
}

.history-table thead th{
  position: sticky;
  top: 0;
  background: rgba(20, 28, 34, .96);
  z-index: 1;
  font-weight: 850;
}

.history-table tbody tr:hover{
  background: rgba(255,255,255,.06);
}

/* Tabs dans l'historique */
.history-tabs{
  display:flex;
  gap: 8px;
  align-items:center;
}

.history-tabs .tab-btn{
  width: auto !important; /* override button{width:100%} */
  padding: 8px 12px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
}

.history-tabs .tab-btn.is-active{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.22);
}

.modal[hidden]{
  display: none !important;
}
/* Cache toutes les modales quand hidden */
.modal[hidden]{
  display: none !important;
}

/* Toolbar: force une ligne, et évite le mode "boutons empilés" */
.toolbar{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  margin: 10px 0 14px;
}

.toolbar-right{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: nowrap;   /* IMPORTANT: pas de wrap sur desktop */
}

/* Boutons compacts */
.btn-mini{
  padding: 8px 10px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
  min-width: auto !important;
}

/* Sur petit écran, autorise le wrap */
@media (max-width: 720px){
  .toolbar-right{ flex-wrap: wrap; }
}
.gen-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.gen-random{
  white-space: nowrap;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  font-weight: 850 !important;
}

.select{
  flex:1;
  height: 42px;
  padding: 0 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:800;
  outline:none;
}

.select option{ color:#111; }

.gen-go{
  padding: 10px 12px !important;
  border-radius: 14px !important;
  white-space: nowrap;
  font-weight: 850 !important;
}

@media (max-width:720px){
  .gen-row{ flex-wrap: wrap; }
  .gen-random{ flex: 1 1 100%; }
  .select{ flex: 1 1 100%; }
  .gen-go{ flex: 1 1 100%; }
}

.btn-big{
  width: 100%;
  padding: 14px 16px !important;
  font-size: 16px !important;
  border-radius: 16px !important;
  font-weight: 900 !important;
}

.finish-screen{
  padding-top: 34px; /* laisse respirer sous la barre de progression */
  min-height: calc(var(--textBoxH) - 20px);
  display: grid;
  place-items: center;
}

.finish-wrap{
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.finish-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
/* ===== FIX Modal Texte: scroll + layout générateur ===== */

/* La carte de la modal Texte peut grandir + scroller si besoin */
#textModal .modal-card{
  max-height: 90vh;
}

/* Le contenu de la modal Texte devient scrollable si trop haut */
#textModal .modal-body{
  overflow: auto;
  padding-bottom: 14px;
}

/* Le textarea doit être bien visible et pas minuscule */
#textModal #customText{
  width: 100%;
  min-height: 140px;
  height: 180px;
  resize: vertical;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

/* IMPORTANT: annule le width:100% global des buttons DANS la gen-row */
#textModal .gen-row > *{
  width: auto !important;
}

/* Layout propre sur desktop */
#textModal .gen-row{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

#textModal .gen-row .select{
  flex: 1;
  min-width: 220px;
}

/* Sur mobile, on empile proprement */
@media (max-width:720px){
  #textModal .gen-row{
    flex-wrap: wrap;
  }
  #textModal .gen-row > *{
    width: 100% !important;
  }
}
/* Boutons fin de partie : 2 colonnes */
.finish-actions{
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width:720px){
  .finish-actions{
    grid-template-columns: 1fr;
  }
}

.btn-wiki{
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
  opacity: .95;
}
/* ===== Modal TEXTE plus grande ===== */
#textModal .modal-card{
  width: min(720px, 96vw);   /* plus large */
  max-height: 92vh;          /* plus haute */
}

#textModal .modal-body{
  max-height: 78vh;          /* laisse la place au header */
  overflow: auto;
}

/* Textarea plus grand par défaut */
#textModal #customText{
  min-height: 260px;         /* <-- augmente ici si tu veux */
  height: 320px;
  resize: vertical;
}

/* Bouton charger moins "massif" */
#textModal #loadBtn{
  padding: 12px 14px !important;
  font-size: 15px !important;
  border-radius: 16px !important;
}


/* Logo en haut */
.brand{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-logo{
  width: 210px;
  height: 60px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.25));
  opacity: .95;
}


.brand h1{
  margin: 0; /* évite les doubles marges */
}
.title-logo{
  display:flex;
  justify-content:center;
  margin: 8px 0 18px;
}

.title-logo img{
  width: 360px;
  height: 110px;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  filter: drop-shadow(0 18px 35px rgba(0,0,0,.35));
}

/* Pages statiques */
.static-page{
  background: linear-gradient(180deg, #0f222b, #122d37);
  color: #f2f4f8;
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
}

.static-page main{
  max-width: 720px;
  background: rgba(255,255,255,0.05);
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  backdrop-filter: blur(6px);
}

.static-page h1{
  text-align: center;
  margin-bottom: 20px;
}

.static-page h2{
  margin-top: 24px;
  color: #88e0c4;
}

.static-page a{
  color: #80c8ff;
  text-decoration: none;
}

.static-page a:hover{
  text-decoration: underline;
}

.logo-static{
  width: 160px;
  display: block;
  margin: 0 auto 24px;
}

.back-home{
  display:block;
  margin-bottom:8px;
  color:#a0b8c4;
  text-decoration:none;
  font-size:14px;
}
.back-home:hover{ text-decoration:underline; }

footer{
  margin-top:40px;
  font-size:14px;
  opacity:.8;
}
/* Footer global (index) */
.site-footer{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  padding: 10px 12px;
  font-size: 13px;
  opacity: .8;
  text-align: center;
}

.site-footer a{
  color: rgba(255,255,255,.85);
  text-decoration: none;
}

.site-footer a:hover{
  text-decoration: underline;
  opacity: 1;
}

.site-footer .sep{
  opacity: .5;
}
.site-footer{
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* Force le footer à être centré même si le parent est en flex "à droite" */
.site-footer{
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;

  margin: 14px auto 0 !important;
  padding: 10px 12px !important;

  /* si le parent est en flex row, ça prend toute la ligne */
  flex: 0 0 100% !important;

  /* si le parent a des alignements bizarres */
  align-self: stretch !important;
}
.learn-btn{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  text-decoration: none;
  color: rgba(255,255,255,.95);
  font-weight: 800;
}

.learn-btn:hover{
  background: rgba(255,255,255,.14);
}

.learn-sep{
  opacity:.5;
  margin: 0 6px;
}

 /* =========================
   Keypress feedback (UX)
   ========================= */
.text-box.flash-ok{
  box-shadow: 0 0 0 2px rgba(34,197,94,.35), 0 18px 40px rgba(34,197,94,.10);
}

.text-box.flash-bad{
  box-shadow: 0 0 0 2px rgba(239,68,68,.40), 0 18px 40px rgba(239,68,68,.10);
  animation: tt-shake 120ms ease-in-out;
}

@keyframes tt-shake{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-2px); }
  50%{ transform: translateX(2px); }
  75%{ transform: translateX(-1px); }
  100%{ transform: translateX(0); }
}

body.reduce-motion .text-box.flash-bad{
  animation: none;
}

/* ===== TapeType Points HUD (v2) ===== */
#textBox{ position:relative; }

/* Total points in toolbar (outside textbox) */
#pointsHud{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: linear-gradient(135deg,
    rgba(59,130,246,.22),
    rgba(168,85,247,.20),
    rgba(34,197,94,.16)
  );
  box-shadow: 0 12px 35px rgba(0,0,0,.22);
  line-height:1;
  user-select:none;
}

#pointsHud .pt-total{
  display:flex;
  align-items:baseline;
  gap:6px;
}
#pointsHud #ptTotal{
  font-size:20px;
  font-weight:900;
  letter-spacing:.2px;
}
#pointsHud .pt-label{
  font-size:12px;
  opacity:.85;
  font-weight:800;
}

#pointsHud .pt-mult{
  font-size:13px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.14);
}

#pointsHud.bump{ animation: ptBump 220ms ease-out; }
#pointsHud.mult-bump{ animation: ptMultBump 320ms cubic-bezier(.2,.9,.2,1); }

@keyframes ptBump{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}
@keyframes ptMultBump{
  0%{ transform: scale(1); }
  30%{ transform: scale(1.08); }
  100%{ transform: scale(1); }
}

/* Pops above typed character */
#pointsPopLayer{
  position:absolute;
  inset:0;
  z-index:19;
  pointer-events:none;
  overflow:visible;
}

.pt-pop{
  position:absolute;
  transform: translate(-50%, -100%);
  font-weight:900;
  font-size:14px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 16px 45px rgba(0,0,0,.22);
  will-change: transform, opacity;
  opacity:0;
  white-space:nowrap;
}

.pt-pop.points{
  background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(16,185,129,.16));
  animation: ptFloat 650ms ease-out forwards;
}
.pt-pop.mult{
  background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(245,158,11,.14));
  animation: ptFloatMult 760ms cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes ptFloat{
  0%{ opacity:0; transform: translate(-50%,-90%) scale(.96); }
  15%{ opacity:1; }
  100%{ opacity:0; transform: translate(-50%,-125%) scale(1.02); }
}
@keyframes ptFloatMult{
  0%{ opacity:0; transform: translate(-50%,-85%) scale(.92); }
  18%{ opacity:1; }
  55%{ opacity:1; transform: translate(-50%,-118%) scale(1.08); }
  100%{ opacity:0; transform: translate(-50%,-138%) scale(1.02); }
}

/* reduce motion */
body.reduce-motion #pointsHud.bump,
body.reduce-motion #pointsHud.mult-bump,
body.reduce-motion .pt-pop.points,
body.reduce-motion .pt-pop.mult{
  animation:none !important;
  opacity:1;
}
/* === Center Points HUD in the toolbar === */
.toolbar{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

/* on garde tes groupes à gauche/droite */
.toolbar-left{
  grid-column: 1;
  justify-self: start;
  display:flex;
  align-items:center;
  gap:10px;
}

.toolbar-right{
  grid-column: 3;
  justify-self: end;
  display:flex;
  align-items:center;
  gap:10px;
}

/* le HUD au centre */
#pointsHud{
  grid-column: 2;
  justify-self: center;
  margin: 0 !important;
}
/* Scale global UI */
:root{
  --ui-scale: 1.12; /* 1.0 = normal, 1.12/1.18 = plus gros */
}

body{
  font-size: calc(16px * var(--ui-scale));
}

/* Agrandir la card / container */
.container{
  max-width: calc(1080px * var(--ui-scale));
}

/* Boutons, inputs, etc */
button, .btn, .btn-primary, .btn-secondary, input, select{
  font-size: 1em;
}

    


/* =========================
   TapeType — UI scale + Points styling
   ========================= */

/* Center the injected points HUD */
.toolbar{
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.toolbar-left{ grid-column: 1; justify-self: start; }
.toolbar-right{ grid-column: 3; justify-self: end; }
#pointsHud{ grid-column: 2; justify-self: center; }

/* ===== Points HUD ===== */
#pointsHud{
  pointer-events:none;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:16px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  line-height:1;
}
#pointsHud .pt-total{
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .2px;
}
#pointsHud .pt-label{
  font-size: 12px;
  font-weight: 850;
  opacity:.85;
  margin-left: 4px;
}
#pointsHud .pt-mult{
  font-size: 13px;
  font-weight: 900;
  padding:7px 10px;
  border-radius: 14px;
  background: rgba(250,204,21,.16);
  border: 1px solid rgba(250,204,21,.28);
}
#pointsHud.bump{ animation: ptBump 220ms ease-out; }
#pointsHud.mult-bump{ animation: ptMultBump 260ms ease-out; }
@keyframes ptBump{
  0%{ transform: translateY(0) scale(1); }
  45%{ transform: translateY(-2px) scale(1.05); }
  100%{ transform: translateY(0) scale(1); }
}
@keyframes ptMultBump{
  0%{ transform: translateY(0) scale(1); }
  30%{ transform: translateY(-2px) scale(1.10); }
  100%{ transform: translateY(0) scale(1); }
}

/* ===== Points Pops ===== */
#pointsPopLayer{
  position:absolute;
  inset:0;
  z-index: 20;
  pointer-events:none;
  overflow:hidden;
}
.pt-pop{
  position:absolute;
  transform: translate(-50%, -100%);
  font-weight: 950;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 14px 40px rgba(0,0,0,.26);
  opacity: 0;
  will-change: transform, opacity;
}
.pt-pop.points{
  background: rgba(74,222,128,.18);
  border-color: rgba(74,222,128,.30);
  color: rgba(230,255,240,.98);
  animation: ptFloat 650ms ease-out forwards;
}
.pt-pop.mult{
  background: rgba(250,204,21,.16);
  border-color: rgba(250,204,21,.32);
  color: rgba(255,248,220,.98);
  animation: ptFloatMult 760ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes ptFloat{
  0%{ opacity:0; transform: translate(-50%, -80%) scale(.96); }
  15%{ opacity:1; }
  100%{ opacity:0; transform: translate(-50%, -140%) scale(1.02); }
}
@keyframes ptFloatMult{
  0%{ opacity:0; transform: translate(-50%, -70%) scale(.94); }
  18%{ opacity:1; }
  55%{ opacity:1; transform: translate(-50%, -130%) scale(1.08); }
  100%{ opacity:0; transform: translate(-50%, -160%) scale(1.02); }
}

/* Reduce motion */
body.reduce-motion #pointsHud.bump,
body.reduce-motion #pointsHud.mult-bump,
body.reduce-motion .pt-pop.points,
body.reduce-motion .pt-pop.mult{
  animation: none !important;
  opacity: 1;
}
