/* Hasard : roue, tirage au sort, pile ou face, dés, nombre aléatoire. */
.hs-zone { min-height: 200px; }
.hs-compte { color: var(--muted); font-weight: 500; }
.hs-puces { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-puce { min-width: 46px; height: 44px; padding: 0 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); font: 600 15px/1 var(--body); color: var(--ink); cursor: pointer; transition: background .2s, box-shadow .2s; }
.hs-puce:hover { box-shadow: 0 0 0 1px rgba(12, 12, 24, .22); }
.hs-puce[aria-pressed="true"] { background: var(--tint); box-shadow: 0 0 0 1.5px rgba(238, 47, 59, .6); color: var(--red-deep); }
.hs-sortie { display: grid; gap: 10px; }
.hs-pop { animation: hs-pop .45s var(--ease); }
@keyframes hs-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* Roue */
.tool-box.hs-roue { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hs-scene, .hs-cote { display: grid; gap: 14px; align-content: start; min-width: 0; }
.hs-cadre { position: relative; width: 100%; max-width: 420px; margin: 8px auto 0; }
.hs-toile { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; box-shadow: 0 18px 40px -22px rgba(12, 12, 24, .55), 0 0 0 1px var(--line); touch-action: manipulation; }
.hs-fleche { position: absolute; left: 50%; top: -10px; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 26px solid var(--ink); border-bottom: 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); pointer-events: none; }
.hs-gagnant { display: grid; gap: 2px; min-height: 86px; align-content: center; padding: 12px 16px; border-radius: 16px; background: var(--soft); text-align: center; }
.hs-gagnant small { font-size: 14px; color: var(--muted); }
.hs-gagnant b { font: 700 clamp(26px, 5vw, 36px)/1.15 var(--head); letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.hs-gagnant b:empty { display: none; }
.hs-gagnant.pop { background: var(--tint); animation: hs-pop .5s var(--ease); }
.hs-gagnant.pop b { color: var(--red-deep); }

/* Tirage au sort, nombres */
.hs-liste { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: rang; }
.hs-liste li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); font: 600 17px/1.3 var(--head); color: var(--ink); overflow-wrap: anywhere; counter-increment: rang; }
.hs-liste li::before { content: counter(rang); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--tint); font-size: 14px; color: var(--red-deep); }
.hs-equipes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hs-equipes ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.hs-nombres { display: flex; flex-wrap: wrap; gap: 8px; max-height: 420px; overflow-y: auto; }
.hs-nombres span { min-width: 46px; padding: 9px 12px; border-radius: 11px; background: #fff; box-shadow: 0 0 0 1px var(--line); font: 700 18px/1.2 var(--head); color: var(--ink); text-align: center; }
.calc-out .res-main b { overflow-wrap: anywhere; }

/* Pile ou face */
.tool-box.hs-pf { justify-items: stretch; }
.hs-tapis { display: grid; place-items: center; height: 250px; border-radius: 18px; background: radial-gradient(circle at 50% 60%, #fff, var(--soft)); perspective: 900px; overflow: hidden; }
.hs-saut { display: block; perspective: 700px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.hs-saut.vole { animation: hs-vol 1.7s cubic-bezier(.3, .6, .4, 1); }
@keyframes hs-vol { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-34px) scale(1.18); } }
.hs-piece { position: relative; display: block; width: 160px; height: 160px; transform-style: preserve-3d; transition: transform 1.7s cubic-bezier(.25, .7, .3, 1); }
.hs-piece span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; font: 800 28px/1 var(--head); letter-spacing: .06em; }
.hs-cote-face { background: radial-gradient(circle at 32% 28%, #ffe9a6, #f0b323 62%, #c98a0a); box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .35), inset 0 0 0 9px rgba(140, 90, 0, .35), 0 14px 26px -14px rgba(120, 80, 0, .8); color: #6b4500; }
.hs-cote-pile { transform: rotateX(180deg); background: radial-gradient(circle at 32% 28%, #fff, #cfd3dc 62%, #9aa0ad); box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .5), inset 0 0 0 9px rgba(70, 76, 90, .3), 0 14px 26px -14px rgba(40, 44, 60, .8); color: #3d4250; }
.hs-verdict { min-height: 44px; font: 700 34px/1.3 var(--head); letter-spacing: -.02em; color: var(--ink); text-align: center; }
.hs-pf .stats .res b { font-size: 20px; }

/* Dés */
.hs-des { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; min-height: 120px; padding: 22px 12px; border-radius: 18px; background: var(--soft); cursor: pointer; }
.hs-de { position: relative; display: grid; place-items: center; width: 76px; height: 76px; font: 800 26px/1 var(--head); color: #fff; }
.hs-de span { position: relative; z-index: 1; }
.hs-des.roule .hs-de { animation: hs-roule .65s ease-in-out; }
.hs-des.roule .hs-de:nth-child(even) { animation-direction: reverse; }
@keyframes hs-roule { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-16px) rotate(140deg); } 60% { transform: translateY(4px) rotate(290deg); } 100% { transform: translateY(0) rotate(360deg); } }
.hs-d6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(12, 12, 24, .14), 0 10px 18px -12px rgba(12, 12, 24, .55); }
.hs-d6 i { width: 13px; height: 13px; border-radius: 50%; }
.hs-d6 i.on { background: var(--ink); }
.hs-d4 { clip-path: polygon(50% 4%, 98% 92%, 2% 92%); background: linear-gradient(160deg, #ff9d2e, #e56a00); padding-top: 22px; }
.hs-d8 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(160deg, #2fbf71, #0b8a45); }
.hs-d10 { clip-path: polygon(50% 0, 97% 40%, 50% 100%, 3% 40%); background: linear-gradient(160deg, #24b8d6, #077f98); padding-bottom: 8px; }
.hs-d12 { clip-path: polygon(50% 2%, 98% 38%, 80% 96%, 20% 96%, 2% 38%); background: linear-gradient(160deg, #8a63ff, #5a2fe0); }
.hs-d20 { clip-path: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%); background: linear-gradient(160deg, #ff5d65, var(--red-deep)); }
.hs-total { text-align: center; }
.hs-total b { font-size: 40px; line-height: 1.15; }

@media (max-width: 720px) {
  .tool-box.hs-roue { grid-template-columns: minmax(0, 1fr); }
  .hs-cadre { max-width: 340px; }
}
@media (max-width: 600px) {
  .hs-equipes { grid-template-columns: 1fr; }
  .hs-zone { min-height: 160px; }
  .hs-de { width: 66px; height: 66px; }
  .hs-pf .stats { grid-template-columns: repeat(3, 1fr); }
  .hs-pf .stats .res { padding: 10px; }
  .hs-pf .stats .res b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-pop, .hs-gagnant.pop, .hs-saut.vole, .hs-des.roule .hs-de { animation: none; }
}
