/* HOMIES-UI — design system (.hm-*) importé dans l'app pour le mode Couple.
   Tokens + composants uniquement (PAS de reset global body/html pour ne rien casser). */
:root{
  --bd:3px; --bd-strong:4px; --sh:5px; --sh-cta:6px; --radius:0px;
  --font-d:'Anton',sans-serif; --font-m:'IBM Plex Mono',monospace;
  --orange:#ff9f45; --purple:#9d4edd; --blue:#4d7cff; --pink:#ff80ab; --teal:#4ecdc4;
}
/* ============================================================
   HOMIES COMPONENT CLASSES (vanilla CSS, framework-agnostic)
   ============================================================ */

/* ---- Buttons ---- */
.hm-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-d);
  border: var(--bd-strong) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--sh) var(--sh) 0 var(--ink);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
}

.hm-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.hm-btn:active {
  transform: translate(var(--sh), var(--sh));
  box-shadow: 0 0 0 var(--ink);
}

.hm-btn:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

.hm-btn-sm {
  font-size: 13px;
  letter-spacing: 1px;
  padding: 8px 13px;
  border-width: var(--bd);
  box-shadow: 3px 3px 0 var(--ink);
}
.hm-btn-md {
  font-size: 16px;
  letter-spacing: 1.5px;
  padding: 13px 18px;
}
.hm-btn-lg {
  font-size: 20px;
  letter-spacing: 2px;
  padding: 16px 22px;
}
.hm-btn-block {
  display: flex;
  width: 100%;
}
.hm-btn-magenta {
  background: var(--magenta);
  color: var(--paper);
}
.hm-btn-yellow {
  background: var(--yellow);
}
.hm-btn-cyan {
  background: var(--cyan);
}
.hm-btn-green {
  background: var(--green);
}
.hm-btn-red {
  background: var(--red);
  color: var(--paper);
}

/* ---- Card (stamp shadow via ::before) ---- */
.hm-card {
  position: relative;
}
.hm-card::before {
  content: '';
  position: absolute;
  top: var(--sh);
  left: var(--sh);
  right: calc(-1 * var(--sh));
  bottom: calc(-1 * var(--sh));
  background: var(--ink);
  z-index: 0;
}
.hm-card > .hm-card-bd {
  position: relative;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  z-index: 1;
}

/* ---- Stamp shadow (generic) ---- */
.hm-stamp {
  position: relative;
}
.hm-stamp::before {
  content: '';
  position: absolute;
  top: var(--sh);
  left: var(--sh);
  right: calc(-1 * var(--sh));
  bottom: calc(-1 * var(--sh));
  background: var(--ink);
  z-index: 0;
}
.hm-stamp > .hm-stamp-bd {
  position: relative;
  z-index: 1;
}

/* ---- Pills ---- */
.hm-pill {
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 0.5px;
  line-height: 1;
  height: 30px;
  padding: 0 11px;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}
.hm-pill-red {
  background: var(--red);
  color: var(--paper);
}
.hm-pill-yellow {
  background: var(--yellow);
}
.hm-pill-green {
  background: var(--green);
}
.hm-pill-cyan {
  background: var(--cyan);
}
.hm-pill-ink {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--magenta);
}

/* ---- Sticker ---- */
.hm-sticker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hm-sticker::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  background: var(--ink);
  z-index: 0;
}
.hm-sticker > .hm-sticker-bd {
  position: relative;
  z-index: 1;
  padding: 5px 12px;
  border: var(--bd) solid var(--ink);
  background: var(--yellow);
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 1px;
}
.hm-sticker-magenta > .hm-sticker-bd {
  background: var(--magenta);
  color: var(--paper);
}

/* ---- Progress segments ---- */
.hm-progress {
  display: flex;
  gap: 6px;
}
.hm-progress .seg {
  flex: 1;
  height: 5px;
  background: var(--gray2);
  border: 2px solid var(--ink);
}
.hm-progress .seg.done {
  background: var(--green);
}
.hm-progress .seg.active {
  background: var(--magenta);
}

/* ---- XP Bar ---- */
.hm-xpbar {
  flex: 1;
  height: 20px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  position: relative;
  overflow: hidden;
}
.hm-xpbar .fill {
  height: 100%;
  background: var(--magenta);
  border-right: 3px solid var(--ink);
  transition: width 0.4s ease;
}
.hm-xpbar .txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 10px;
  letter-spacing: 1px;
}

/* ---- Level badge ---- */
.hm-level-badge {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 3px solid var(--ink);
  background: var(--magenta);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-d);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.hm-level-badge .n {
  font-size: 18px;
}
.hm-level-badge .l {
  font-size: 6px;
  letter-spacing: 1px;
  margin-top: 1px;
}

/* ---- Input ---- */
.hm-input {
  width: 100%;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 13px 14px;
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 16px;
  outline: none;
  color: var(--ink);
}
.hm-input::placeholder {
  color: color-mix(in srgb, var(--ink) 40%, transparent);
}
.hm-input:focus {
  background: #fff;
  box-shadow: 4px 4px 0 var(--magenta);
}

/* ---- Segmented control ---- */
.hm-seg {
  display: inline-flex;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.hm-seg .o {
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 9px 14px;
  border-right: 3px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: background 0.15s ease;
}
.hm-seg .o:last-child {
  border-right: 0;
}
.hm-seg .o.on {
  background: var(--magenta);
  color: var(--paper);
}

/* ---- Stat card ---- */
.hm-statcard {
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper);
  text-align: center;
  padding: 11px 6px;
}
.hm-statcard .v {
  font-family: var(--font-d);
  font-size: 24px;
  line-height: 1;
}
.hm-statcard .l {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.hm-statcard-a {
  background: var(--yellow);
}
.hm-statcard-b {
  background: var(--green);
}
.hm-statcard-c {
  background: var(--cyan);
}

/* ---- Toast ---- */
.hm-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 3px solid var(--ink);
  background: var(--green);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px;
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ---- Badge ---- */
.hm-badge-ic {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Marquee ---- */
.hm-marquee {
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  white-space: nowrap;
  padding: 5px 0;
  font-family: var(--font-d);
  font-size: 11px;
  letter-spacing: 2px;
}

/* ============================================================
   SOCLE V2 — porté depuis clone_kahoot/design-mockups/proto.css
   ============================================================ */

/* ---- Noto animated emoji (inline) ---- */
.hm-nemoji {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  object-fit: contain;
}

/* ---- Emoji box ---- */
.hm-emojibox {
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 var(--ink);
}
.hm-emojibox-s { width: 34px; height: 34px; }
.hm-emojibox-s .hm-nemoji { width: 24px; height: 24px; }
.hm-emojibox-m { width: 44px; height: 44px; }
.hm-emojibox-m .hm-nemoji { width: 32px; height: 32px; }
.hm-emojibox-l { width: 64px; height: 64px; }
.hm-emojibox-l .hm-nemoji { width: 46px; height: 46px; }

/* ---- Avatar (jamais à plat : toujours une ombre dure) ---- */
.hm-avatar {
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  box-shadow: 4px 4px 0 var(--ink);
}
.hm-avatar img { width: 100%; height: 100%; display: block; }
.hm-avatar-s { width: 36px; height: 36px; }
.hm-avatar-m { width: 48px; height: 48px; }
.hm-avatar-l { width: 72px; height: 72px; }

/* ---- Avatar + pastille de niveau ---- */
.hm-avatar-lv { position: relative; display: inline-block; }
.hm-avatar-lv .lv {
  position: absolute;
  bottom: -7px;
  right: -7px;
  background: var(--magenta);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--font-d);
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  box-shadow: 1px 1px 0 var(--ink);
}

/* ---- Top bar ---- */
.hm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: var(--bd) solid var(--ink);
  flex-shrink: 0;
  background: var(--paper);
}
.hm-topbar .left { display: flex; align-items: center; gap: 10px; }
.hm-page-title {
  font-family: var(--font-d);
  font-size: 22px;
  letter-spacing: 2px;
}
.hm-step-counter {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.5px;
  opacity: 0.55;
}

/* ---- Icon button ---- */
.hm-iconbtn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-d);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}
.hm-iconbtn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.hm-iconbtn-red { background: var(--red); color: var(--paper); }

/* ---- HUD (bandeau de pills de jeu) ---- */
.hm-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
}
.hm-hud .spacer { flex: 1; }

/* ---- Type pill (label de manche, double couche) ---- */
.hm-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  position: relative;
  transform: rotate(-1deg);
}
.hm-type-pill .sh {
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  background: var(--ink);
}
.hm-type-pill .bd {
  position: relative;
  padding: 6px 14px;
  border: var(--bd) solid var(--ink);
  background: var(--cyan);
  color: #0a0a0a;
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hm-type-pill .hm-nemoji { width: 16px; height: 16px; }

/* ---- Brand (logo encadré) ---- */
.hm-brand { position: relative; display: inline-block; }
.hm-brand::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  background: var(--ink);
}
.hm-brand .b {
  position: relative;
  display: inline-block;
  padding: 6px 12px;
  border: var(--bd) solid var(--ink);
  background: var(--magenta);
  font-family: var(--font-d);
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--paper);
}

/* ---- List card (pack / jeu / format) ---- */
.hm-listcard { position: relative; margin-bottom: 10px; }
.hm-listcard::before {
  content: '';
  position: absolute;
  top: var(--sh);
  left: var(--sh);
  right: calc(-1 * var(--sh));
  bottom: calc(-1 * var(--sh));
  background: var(--ink);
}
.hm-listcard .bd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  padding: 10px 12px;
}
.hm-listcard-on .bd { background: #ffe99c; color: #0a0a0a; }
.hm-listcard-sel .bd {
  background: var(--yellow);
  color: #0a0a0a;
  transform: translate(var(--sh), var(--sh));
}
.hm-listcard-sel::before { display: none; }
.hm-listcard .info { flex: 1; min-width: 0; }
/* titres : toujours sur une ligne, "…" si trop long */
.hm-listcard .name {
  font-family: var(--font-d);
  font-size: 15px;
  letter-spacing: 0.5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-listcard .desc {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 10px;
  line-height: 1.25;
  opacity: 0.6;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Stepper (− N +) : symboles dessinés en CSS = centrés au pixel ---- */
.hm-stepper { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hm-stepper .sbtn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 2.5px solid var(--ink);
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
  position: relative;
  cursor: pointer;
}
.hm-stepper .sbtn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 3px;
  background: #0a0a0a;
  transform: translate(-50%, -50%);
}
.hm-stepper .sbtn.plus::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 13px;
  background: #0a0a0a;
  transform: translate(-50%, -50%);
}
.hm-stepper .sval {
  font-family: var(--font-d);
  font-size: 22px;
  min-width: 26px;
  text-align: center;
  line-height: 1;
}

/* ---- Toggle button : AJOUTER → ACTIVÉ (ni switch ni checkbox) ---- */
.hm-toggle-btn {
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.5px;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.hm-toggle-btn-on { background: var(--green); color: #0a0a0a; }
.hm-toggle-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

/* ---- Options (réponse A/B/C/D) ---- */
.hm-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hm-option { position: relative; }
.hm-option .sh {
  position: absolute;
  top: 5px;
  left: 5px;
  right: -5px;
  bottom: -5px;
  background: var(--ink);
}
.hm-option .bd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
}
.hm-option .lwrap { position: relative; flex-shrink: 0; }
.hm-option .lwrap .lsh {
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  background: var(--ink);
}
.hm-option .lbox {
  position: relative;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-option .text {
  font-family: var(--font-d);
  font-size: 16px;
  letter-spacing: 0.3px;
  line-height: 1.15;
  flex: 1;
}
.hm-option-yellow .bd { background: var(--yellow); color: #0a0a0a; }
.hm-option-violet .bd { background: var(--purple); color: #fffef7; }
.hm-option-red .bd { background: var(--red); color: #fffef7; }
.hm-option-teal .bd { background: var(--teal); color: #fffef7; }
/* états : tampon coin (✓ / ✗ dessinés), sélection, reveal */
.hm-option .stamp {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translateY(-50%) rotate(8deg);
  z-index: 3;
  display: none;
}
.hm-option-selected .bd,
.hm-option-correct .bd { border-width: 5px; }
.hm-option-selected .bd,
.hm-option-correct .bd,
.hm-option-wrong .bd { padding-right: 52px; }
.hm-option-selected .stamp,
.hm-option-correct .stamp { display: block; background: var(--green); }
.hm-option-selected .stamp::before,
.hm-option-correct .stamp::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 4px;
  width: 6px;
  height: 13px;
  border: solid #0a0a0a;
  border-width: 0 3px 3px 0;
  transform: rotate(42deg);
}
.hm-option-correct .bd { background: var(--green); color: #0a0a0a; }
.hm-option-wrong .bd { background: var(--red); color: #fffef7; }
.hm-option-wrong .stamp { display: block; background: var(--red); }
.hm-option-wrong .stamp::before,
.hm-option-wrong .stamp::after {
  content: '';
  position: absolute;
  left: 12.5px;
  top: 5px;
  width: 3px;
  height: 18px;
  background: #fffef7;
}
.hm-option-wrong .stamp::before { transform: rotate(45deg); }
.hm-option-wrong .stamp::after { transform: rotate(-45deg); }
.hm-option-faded { opacity: 0.38; }

/* ---- Q-card (énoncé) ---- */
.hm-qcard { position: relative; }
.hm-qcard .sh {
  position: absolute;
  top: 5px;
  left: 5px;
  right: -5px;
  bottom: -5px;
  background: var(--ink);
}
.hm-qcard .bd {
  position: relative;
  padding: 14px;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  font-family: var(--font-d);
  font-size: 18px;
  line-height: 1.2;
}

/* ---- Bottom nav ---- */
.hm-bottomnav {
  display: flex;
  border-top: var(--bd) solid var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}
.hm-bottomnav .it {
  flex: 1;
  text-align: center;
  padding: 8px 0 9px;
  font-family: var(--font-d);
  font-size: 9px;
  letter-spacing: 0.5px;
  opacity: 0.55;
  cursor: pointer;
}
.hm-bottomnav .it .hm-nemoji {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto 3px;
}
.hm-bottomnav .it.on { opacity: 1; }
.hm-bottomnav .it.on .lbl {
  background: var(--magenta);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 1px 5px;
}

/* ---- Bottom nav, variante icônes seules ----
   Sans libellé, l'état actif ne peut plus passer par `.lbl`. L'icône entre donc
   dans un carré : bordure épaisse, fond magenta, ombre dure décalée — la seule
   façon de désigner l'onglet courant sans texte, sans radius et sans dégradé.
   Hauteur totale de la barre : 52px + 3px de bordure haute = 55px. */
.hm-bottomnav-icons .it {
  padding: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-bottomnav-icons .it .ico {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid transparent;
}
.hm-bottomnav-icons .it .hm-nemoji {
  width: 22px;
  height: 22px;
  margin: 0;
}
.hm-bottomnav-icons .it.on .ico {
  border-color: var(--ink);
  background: var(--magenta);
  color: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---- Level bar (badge + XP) ---- */
.hm-levelbar { display: flex; align-items: center; gap: 10px; }

/* ---- Badges / trophées ---- */
.hm-badge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.hm-badge { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hm-badge .ic {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-badge .ic .hm-nemoji { width: 58%; height: 58%; }
.hm-badge-locked .ic { background: var(--gray2); }
.hm-badge-locked .ic .hm-nemoji { filter: grayscale(1); opacity: 0.45; }
.hm-badge .nm {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 8px;
  text-align: center;
  line-height: 1.15;
}

/* ---- Médaille + puce de rang ---- */
.hm-medal {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hm-medal .hm-nemoji { width: 24px; height: 24px; }
.hm-medal-gold { background: var(--yellow); }
.hm-medal-silver { background: #dadada; }
.hm-medal-bronze { background: var(--orange); }
.hm-rankchip {
  font-family: var(--font-d);
  font-size: 14px;
  line-height: 1;
  border: 2.5px solid var(--ink);
  background: var(--magenta);
  color: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 5px 8px;
}
.hm-rankchip-gold { background: var(--yellow); color: #0a0a0a; }

/* ---- Code cells (code de partie) ---- */
.hm-codecells { display: flex; gap: 8px; }
.hm-codecells .cell {
  width: 44px;
  height: 54px;
  flex-shrink: 0;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper);
  font-family: var(--font-d);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-codecells .cell.filled { background: var(--yellow); color: #0a0a0a; }

/* ---- Leaderboard row ---- */
.hm-lbrow {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--paper);
  padding: 9px 12px;
}
.hm-lbrow-me { background: var(--yellow); color: #0a0a0a; }
.hm-lbrow .rk {
  font-family: var(--font-d);
  font-size: 18px;
  min-width: 26px;
  text-align: center;
}
.hm-lbrow .nm {
  font-family: var(--font-d);
  font-size: 15px;
  letter-spacing: 0.3px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-lbrow .sc { font-family: var(--font-d); font-size: 17px; }

/* ---- Player tile (salon) ---- */
.hm-ptile { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hm-ptile .nm {
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.3px;
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Play card (Couple / Soirée) ---- */
.hm-playcard { position: relative; }
.hm-playcard::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: -8px;
  bottom: -8px;
  background: var(--ink);
}
.hm-playcard .bd {
  position: relative;
  border: 5px solid var(--ink);
  background: var(--paper);
  padding: 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
}
.hm-playcard .corner { font-family: var(--font-d); font-size: 13px; }
.hm-playcard .lvltag {
  align-self: flex-start;
  font-family: var(--font-d);
  font-size: 11px;
  border: 2.5px solid var(--ink);
  background: var(--green);
  color: #0a0a0a;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 3px 9px;
}
.hm-playcard .txt {
  font-family: var(--font-d);
  font-size: 22px;
  line-height: 1.25;
  margin: auto 0;
  text-align: center;
}

/* ---- Bottom sheet ---- */
.hm-sheet { position: relative; }
.hm-sheet::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  right: -7px;
  bottom: -7px;
  background: var(--ink);
}
.hm-sheet .bd {
  position: relative;
  border: 4px solid var(--ink);
  background: var(--paper);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hm-sheet .handle {
  width: 50px;
  height: 5px;
  background: var(--ink);
  margin: -8px auto 2px;
}

/* ---- CTA (bouton principal de bas d'écran) ---- */
.hm-cta { position: relative; cursor: pointer; }
.hm-cta::before {
  content: '';
  position: absolute;
  top: var(--sh-cta);
  left: var(--sh-cta);
  right: calc(-1 * var(--sh-cta));
  bottom: calc(-1 * var(--sh-cta));
  background: var(--ink);
}
.hm-cta .bd {
  position: relative;
  border: var(--bd-strong) solid var(--ink);
  padding: 14px;
  font-family: var(--font-d);
  font-size: 18px;
  letter-spacing: 2px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--magenta);
  color: var(--paper);
}
.hm-cta-go .bd { background: var(--green); color: #0a0a0a; font-size: 20px; }
.hm-cta .count {
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  padding: 1px 8px;
  font-size: 13px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

/* ============================================================
   GAME — composants nés après proto.css, extraits de l'app
   (public/css/brutal.css, host.css, jpo-*.css, classement.css)
   ============================================================ */

/* ---- Chrono (gros compte à rebours, écran hôte) ----
   L'app le dessine rond avec un balayage `conic-gradient` (.jgc-chrono).
   Ici : carré et sans dégradé — le socle interdit les deux. Le temps écoulé
   monte en voile depuis le bas, piloté par `--fill` (0% → 100%).
   Le voile est en dur (`rgba(10,10,10,…)`) : il doit rester sombre sur le
   jaune de marque, qui ne change pas selon le thème. */
.hm-chrono {
  --fill: 0%;
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border: 5px solid var(--ink);
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hm-chrono::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill);
  background: rgba(10, 10, 10, 0.78);
  pointer-events: none;
}
.hm-chrono .num {
  position: relative;
  z-index: 2;
  width: 66%;
  height: 66%;
  border: var(--bd-strong) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 38px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-chrono-low {
  background: var(--red);
  animation: hm-beat 0.5s infinite alternate;
}
@keyframes hm-beat {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* ---- Timer compact : pill numérique + barre de temps ---- */
.hm-timer {
  display: inline-block;
  font-family: var(--font-d);
  font-size: 18px;
  line-height: 1;
  min-width: 54px;
  padding: 6px 12px;
  text-align: center;
  border: var(--bd) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--yellow);
  color: #0a0a0a;
}
.hm-timer-hot {
  background: var(--red);
  color: #fffef7;
  animation: hm-beat 0.5s infinite alternate;
}
.hm-timer-bar {
  width: 100%;
  height: 14px;
  border: var(--bd) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper);
  overflow: hidden;
}
.hm-timer-bar > i {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.2s linear;
}

/* ---- Buzzer (gros bouton pression + halo) ----
   L'app le dessine rond (.jbz-buzz). Ici : carré — le socle interdit
   border-radius. Le relief vient de l'ombre double (tranche + portée) et
   le « prends-moi » du halo qui se propage. */
.hm-buzzer {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  border: 6px solid var(--ink);
  background: var(--red);
  box-shadow: 0 9px 0 #b22222, 9px 16px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-d);
  font-size: 34px;
  letter-spacing: 2px;
  color: #fffef7;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  animation: hm-buzz-pulse 1.3s ease-in-out infinite;
}
.hm-buzzer .halo {
  position: absolute;
  inset: -6px;
  border: 6px solid var(--red);
  opacity: 0;
  pointer-events: none;
  animation: hm-buzz-ripple 1.6s ease-out infinite;
}
.hm-buzzer .hm-nemoji {
  width: 58px;
  height: 58px;
}
/* état « déjà buzzé » : couple en dur, pour rester lisible dans les 7 thèmes */
.hm-buzzer-sent {
  animation: none;
  transform: translateY(6px);
  box-shadow: 0 3px 0 #8a8a8a, 3px 6px 0 var(--ink);
  background: #c8c8c8;
  color: #0a0a0a;
  text-shadow: none;
}
.hm-buzzer-sent .halo {
  display: none;
}
@keyframes hm-buzz-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
@keyframes hm-buzz-ripple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ---- Podium (top 3, marches inégales) ----
   Ordre du DOM = 2 · 1 · 3, pour que la plus haute marche soit au centre. */
.hm-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}
.hm-podium .pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.hm-podium .nm {
  font-family: var(--font-d);
  font-size: 13px;
  letter-spacing: 0.3px;
  margin-top: 8px;
  max-width: 84px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-podium .sc {
  font-family: var(--font-d);
  font-size: 14px;
  line-height: 1;
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 3px 9px;
  margin-top: 5px;
}
.hm-podium .block {
  width: 100%;
  margin-top: 8px;
  border: var(--bd) solid var(--ink);
  border-bottom: 0;
  box-shadow: 4px 0 0 var(--ink);
  font-family: var(--font-d);
  font-size: 30px;
  line-height: 1;
  color: #0a0a0a;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
}
.hm-podium .pod-1 .block {
  background: var(--yellow);
  height: 96px;
}
.hm-podium .pod-2 .block {
  background: var(--cyan);
  height: 70px;
}
.hm-podium .pod-3 .block {
  background: var(--orange);
  height: 52px;
}

/* ---- Streak (série en cours) ----
   Fond ink → ombre magenta, jamais noir sur noir. Le compteur est encadré
   en jaune pour garder l'accent chaud dans les thèmes sombres. */
.hm-streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-d);
  font-size: 14px;
  letter-spacing: 1px;
  border: var(--bd) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--magenta);
  padding: 7px 13px;
  transform: rotate(-1deg);
}
.hm-streak .n {
  font-size: 15px;
  line-height: 1;
  background: var(--yellow);
  color: #0a0a0a;
  border: 2px solid var(--paper);
  padding: 2px 7px;
}
.hm-streak .hm-nemoji {
  width: 18px;
  height: 18px;
}

/* ---- Chips (filtres, étiquettes de config) — hauteur unique 30px ---- */
.hm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hm-chip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.hm-chip::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  background: var(--ink);
}
.hm-chip .bd {
  position: relative;
  height: 30px;
  padding: 0 11px;
  border: var(--bd) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hm-chip .hm-nemoji {
  width: 15px;
  height: 15px;
}
.hm-chip-yellow .bd {
  background: var(--yellow);
  color: #0a0a0a;
}
.hm-chip-cyan .bd {
  background: var(--cyan);
  color: #0a0a0a;
}
.hm-chip-green .bd {
  background: var(--green);
  color: #0a0a0a;
}
.hm-chip-on .bd {
  background: var(--ink);
  color: var(--paper);
}
.hm-chip-on::before {
  background: var(--magenta);
}
.hm-chip-off {
  opacity: 0.45;
}

/* ---- Empty state (rien à afficher, mais rien à plat non plus) ---- */
.hm-empty {
  position: relative;
  transform: rotate(-1deg);
}
.hm-empty::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  right: -7px;
  bottom: -7px;
  background: var(--ink);
}
.hm-empty .bd {
  position: relative;
  border: var(--bd-strong) solid var(--ink);
  background: var(--yellow);
  color: #0a0a0a;
  padding: 24px 18px;
  text-align: center;
}
.hm-empty .hm-nemoji {
  width: 72px;
  height: 72px;
}
.hm-empty .title {
  font-family: var(--font-d);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 1px;
  margin-top: 10px;
}
.hm-empty .sub {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 8px;
  color: rgba(10, 10, 10, 0.75);
}

/* ---- QR de salon ---- */
.hm-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  border: var(--bd-strong) solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--cyan);
  color: #0a0a0a;
  padding: 12px;
}
.hm-qr > img {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  display: block;
  image-rendering: pixelated;
  border: var(--bd) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: #fffef7;
}
.hm-qr .cap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hm-qr .tag {
  align-self: flex-start;
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 1px;
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--magenta);
  color: #fffef7;
  padding: 4px 10px;
  transform: rotate(-2deg);
}
.hm-qr .txt {
  font-family: var(--font-d);
  font-size: 16px;
  letter-spacing: 0.5px;
  line-height: 1.15;
}
.hm-qr .url {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
  word-break: break-all;
  color: rgba(10, 10, 10, 0.65);
}

/* ---- Wager (slider de mise) ---- */
.hm-wager {
  position: relative;
  width: 100%;
  max-width: 300px;
}
.hm-wager::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: -6px;
  bottom: -6px;
  background: var(--ink);
}
.hm-wager .bd {
  position: relative;
  border: var(--bd-strong) solid var(--ink);
  background: var(--paper);
  padding: 18px 16px 14px;
  text-align: center;
}
.hm-wager .val {
  font-family: var(--font-d);
  font-size: 46px;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--ink);
}
.hm-wager .val span {
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  margin-left: 5px;
}
.hm-wager .track {
  position: relative;
  height: 24px;
  margin: 14px 0 8px;
  border: var(--bd) solid var(--ink);
  background: var(--gray2);
  cursor: pointer;
  touch-action: none;
}
.hm-wager .track .fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--yellow);
  border-right: var(--bd) solid var(--ink);
}
.hm-wager .track .thumb {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: var(--bd) solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--paper);
  pointer-events: none;
}
.hm-wager .limits {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-m);
  font-weight: 700;
  font-size: 10px;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}

/* ---- Confetti (overlay de victoire) ----
   Le parent doit être `position: relative`. Chaque `<i>` porte son propre
   `left` / `background` / `animation-delay`. */
.hm-confetti-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hm-confetti-overlay > i {
  position: absolute;
  top: -14px;
  width: 10px;
  height: 14px;
  border: 2px solid var(--ink);
  animation: hm-confetti 2.6s linear infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* ---- Press ---- */
@keyframes hm-press {
  0% {
    transform: translate(0, 0);
    box-shadow: var(--sh) var(--sh) 0 var(--ink);
  }
  100% {
    transform: translate(var(--sh), var(--sh));
    box-shadow: 0 0 0 var(--ink);
  }
}

/* ---- Pop ---- */
@keyframes hm-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* ---- Shake ---- */
@keyframes hm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* ---- Reveal ---- */
@keyframes hm-reveal {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Flip ---- */
@keyframes hm-flip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

/* ---- Float ---- */
@keyframes hm-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---- Confetti fall ---- */
@keyframes hm-confetti {
  0% { transform: translateY(-100%) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- Badge unlock ---- */
@keyframes hm-badge-unlock {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(-3deg); opacity: 1; }
}

/* ---- Marquee scroll ---- */
@keyframes hm-marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- XP gain ---- */
@keyframes hm-xp-gain {
  0% { width: 0%; }
  100% { width: var(--target-w, 62%); }
}

/* ---- Loading dots ---- */
@keyframes hm-loading {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ---- Shuffle ---- */
@keyframes hm-shuffle {
  0% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-12px) rotate(-5deg); }
  50% { transform: translateX(12px) rotate(5deg); }
  75% { transform: translateX(-8px) rotate(-3deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* ---- Glow pulse ---- */
@keyframes hm-glow {
  0%, 100% { box-shadow: var(--sh) var(--sh) 0 var(--ink), 0 0 0 0 rgba(255, 46, 147, 0.4); }
  50% { box-shadow: var(--sh) var(--sh) 0 var(--ink), 0 0 0 8px rgba(255, 46, 147, 0); }
}

/* ---- Slide in ---- */
@keyframes hm-slide-in {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ---- Bounce in ---- */
@keyframes hm-bounce-in {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ---- Tilt ---- */
@keyframes hm-tilt {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

/* ---- Slide up fade ---- */
@keyframes hm-slide-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- Utility animation classes ---- */
.anim-pop {
  animation: hm-pop 0.3s ease;
}
.anim-shake {
  animation: hm-shake 0.4s ease;
}
.anim-reveal {
  animation: hm-reveal 0.3s ease;
}
.anim-float {
  animation: hm-float 3s ease-in-out infinite;
}
.anim-tilt {
  animation: hm-tilt 4s ease-in-out infinite;
}
.anim-bounce-in {
  animation: hm-bounce-in 0.5s ease;
}
.anim-slide-up {
  animation: hm-slide-up 0.4s ease;
}
.anim-badge-unlock {
  animation: hm-badge-unlock 0.6s ease;
}

/* ============================================================
   PATTERNS (backgrounds)
   ============================================================ */

/* ---- Dots ---- */
.pat-dots {
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 12%, transparent) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

/* ---- Grid ---- */
.pat-grid {
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---- Diagonal stripes ---- */
.pat-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    var(--ink) 0,
    var(--ink) 2px,
    transparent 2px,
    transparent 12px
  );
}

/* ---- Checkerboard ---- */
.pat-checker {
  background-image: linear-gradient(45deg, color-mix(in srgb, var(--ink) 8%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--ink) 8%, transparent) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--ink) 8%, transparent) 75%),
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--ink) 8%, transparent) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* ---- Memphis ---- */
.pat-memphis {
  background-color: var(--yellow);
  background-image: radial-gradient(circle at 20% 30%, var(--magenta) 4px, transparent 5px),
    radial-gradient(circle at 70% 60%, var(--cyan) 6px, transparent 7px),
    linear-gradient(135deg, transparent 48%, var(--ink) 49%, var(--ink) 51%, transparent 52%);
  background-size: 60px 60px, 80px 80px, 40px 40px;
}

/* ---- Noise (paper texture) ---- */
.pat-noise {
  position: relative;
}
.pat-noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ---- Pixel ---- */
.pat-pixel {
  background-color: var(--cyan);
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 10%, transparent) 2px, transparent 2px);
  background-size: 8px 8px;
}

/* ---- Comic (halftone) ---- */
.pat-comic {
  background-color: var(--yellow);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 18%, transparent) 1px, transparent 2px);
  background-size: 10px 10px;
}

/* ---- Game grid ---- */
.pat-game {
  background-color: var(--paper);
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 2px, transparent 2px);
  background-size: 16px 16px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--gray2);
  border-left: 2px solid var(--ink);
}
::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 2px solid var(--gray2);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--magenta);
}

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.font-display {
  font-family: var(--font-d);
}
.font-mono {
  font-family: var(--font-m);
}

/* ============================================================
   CODE BLOCK
   ============================================================ */
.code-block {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-m);
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--magenta);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.code-block .tok-tag {
  color: var(--magenta);
}
.code-block .tok-attr {
  color: var(--cyan);
}
.code-block .tok-str {
  color: var(--green);
}
.code-block .tok-com {
  color: var(--gray);
  font-style: italic;
}

/* ============================================================
   MISC
   ============================================================ */
.no-scroll {
  overflow: hidden;
}

/* Hide scrollbar for horizontal scroll areas */
.hide-scroll::-webkit-scrollbar {
  display: none;
}
.hide-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Selection */
::selection {
  background: var(--magenta);
  color: var(--paper);
}
