/* Base */
* { box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  background: #0b1220;
  color: #111;
}

/* FIXED */
.fixed-banner{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: rgba(255,255,255,0.9);
  border: 2px solid #000;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 700;
}

/* STICKY header (reste dans le flow, puis colle au scroll) */
.sticky-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 2px solid #000;
  padding: 12px 16px;
  font-weight: 800;
}

/* Layout */
.container{
  padding: 18px 16px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

h1{
  color: #fff;
  margin: 14px 0 16px;
}

.card{
  background: #ffffff;
  border: 2px solid #000;
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 16px;
}

.row{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.box{
  width: 320px;
  min-height: 140px;
  border: 2px solid #000;
  border-radius: 14px;
  padding: 12px;
  background: #f3f4f6;
}

.box p{ margin: 8px 0 0; }

/* 1) static (par défaut) */
.static{
  position: static;
}

/* 1) relative : bouge avec top/left MAIS garde sa place dans le flow */
.relative{
  position: relative;
  top: 8px;     /* bouge visuellement */
  left: 10px;   /* bouge visuellement */
  background: #e0f2fe;
}

/* Badge ABSOLUTE : se place par rapport au parent positionné (.relative) */
.badge{
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border: 2px solid #000;
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}

/* 2) Absolute démo */
.abs-demo{ margin-top: 10px; }

.abs-box{
  position: relative; /* IMPORTANT : référence pour l'enfant absolute */
  min-height: 180px;
  border: 2px dashed #000;
  border-radius: 14px;
  padding: 12px;
  background: #fff7ed;
}

.absolute{
  position: absolute;
  top: 12px;
  right: 12px;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fdba74;
  font-weight: 800;
}

/* 3) z-index */
.z-demo{
  position: relative;
  height: 160px;
  border: 2px dashed #000;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.layer{
  position: absolute;
  width: 180px;
  height: 110px;
  border: 2px solid #000;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.layer.a{
  top: 25px;
  left: 25px;
  z-index: 1;
  background: #93c5fd;
}
.layer.b{
  top: 40px;
  left: 90px;
  z-index: 2;
  background: #86efac;
}
.layer.c{
  top: 55px;
  left: 155px;
  z-index: 3;
  background: #fca5a5;
}

.hint{
  margin: 10px 0 0;
  color: #374151;
}

/* 4) Centrage absolute + transform */
.center-parent{
  position: relative;
  height: 180px;
  border: 2px dashed #000;
  border-radius: 14px;
  background: #eef2ff;
}

.centered{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* “ramène” au centre */
  padding: 10px 12px;
  border: 2px solid #000;
  border-radius: 14px;
  background: #c7d2fe;
  font-weight: 900;
}

/* 5) Sticky dans une section */
.sticky-section{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: start;
}

.sticky-side{
  position: sticky;
  top: 68px; /* sous le sticky header */
  border: 2px solid #000;
  border-radius: 14px;
  padding: 10px;
  background: #dcfce7;
  font-weight: 900;
}

.long-text{
  border: 2px solid #000;
  border-radius: 14px;
  padding: 10px 12px;
  background: #f9fafb;
}
.long-text p{ margin: 0 0 10px; }
