/* ===== Réglages du son =====
   Une feuille posée par-dessus n'importe quel écran (accueil, salon, partie) : feutre en haut, carton crème dessous.
   Tout est préfixé « snd- » pour ne rien emprunter aux jeux (ils ont leurs propres boutons et curseurs). */

html.snd-open, html.snd-open body { overflow: hidden; }

.snd {
  position: fixed; inset: 0; z-index: 6000; display: flex; align-items: flex-end; justify-content: center;
  font-family: var(--pl-sans, "Nunito", system-ui, sans-serif); color: var(--pl-ink, #1d2823); line-height: 1.4;
}
.snd *, .snd *::before, .snd *::after { box-sizing: border-box; }
.snd h2, .snd p { margin: 0; }
.snd button { font-family: inherit; }
.snd :focus-visible { outline: 3px solid var(--pl-brass-deep, #8c6012); outline-offset: 2px; }
.snd-top :focus-visible { outline-color: var(--pl-brass-hi, #f4d27c); }

.snd-scrim { position: absolute; inset: 0; background: rgb(6 20 16 / .7); backdrop-filter: blur(3px); animation: snd-fade .2s ease both; }
.snd-sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 94dvh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--pl-card, #fbf5e8); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px -20px rgb(0 0 0 / .7);
  animation: snd-up .26s cubic-bezier(.2, .8, .2, 1) both;
}
@media (min-width: 560px) {
  .snd { align-items: center; }
  .snd-sheet { border-radius: 22px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .12); }
}
@keyframes snd-fade { from { opacity: 0; } }
@keyframes snd-up { from { transform: translateY(24px); opacity: 0; } }

.snd-top {
  flex: none; display: flex; align-items: center; gap: .8rem; padding: 12px 12px 12px 16px; color: var(--pl-on, #f6efdb);
  background: radial-gradient(ellipse 120% 160% at 30% 0%, var(--pl-felt-1, #236352), var(--pl-felt-2, #17483b) 60%, var(--pl-felt-3, #0e2d26));
  border-bottom: 3px solid var(--pl-brass, #dfaa3f);
}
.snd-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #2b1d04; background: linear-gradient(#f7da86, var(--pl-brass, #dfaa3f)); box-shadow: 0 2px 0 var(--pl-brass-deep, #8c6012); }
.snd-ico .icon { width: 24px; height: 24px; display: block; }
.snd-titles { flex: 1; min-width: 0; }
.snd-titles small { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--pl-brass-hi, #f4d27c); }
.snd-titles h2 { font: 700 1.3rem/1.15 var(--pl-serif, "Fraunces", Georgia, serif); }
.snd-x {
  flex: none; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; color: var(--pl-on, #f6efdb); touch-action: manipulation;
  background: rgb(255 255 255 / .08); border: 1.5px solid rgb(246 239 219 / .3); display: grid; place-items: center;
}
.snd-x b { font: 400 1.9rem/1 var(--pl-sans, sans-serif); margin-top: -2px; }
.snd-x:hover { background: rgb(255 255 255 / .16); }

.snd-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .8rem; }
.snd-row { padding: 12px 14px 14px; background: #fff; border: 1.5px solid var(--pl-edge, #d6c6a3); border-radius: 16px; transition: opacity .15s; }
.snd-row.off .snd-slide, .snd-row.off .snd-hint { opacity: .45; }
.snd-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.snd-head label, .snd-head strong { font: 700 1.05rem/1.25 var(--pl-serif, "Fraunces", Georgia, serif); }
.snd-hint { margin-top: .15rem; color: var(--pl-ink-2, #46534c); font-size: .85rem; }
.snd-line .snd-head { align-items: flex-start; }

/* interrupteur */
.snd-switch {
  flex: none; position: relative; width: 56px; height: 32px; padding: 0; cursor: pointer; border-radius: 999px; touch-action: manipulation;
  background: #9aa59d; border: 0; box-shadow: inset 0 2px 3px rgb(0 0 0 / .25); transition: background .15s;
}
.snd-switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px rgb(0 0 0 / .35); transition: translate .15s; }
.snd-switch[aria-checked="true"] { background: #2a9a5f; }
.snd-switch[aria-checked="true"] i { translate: 24px 0; }
.snd-switch::after { content: ''; position: absolute; inset: -8px -4px; } /* zone de toucher plus large */

/* curseur */
.snd-slide { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; }
.snd-val { flex: none; width: 3.4rem; text-align: right; font: 800 .95rem var(--pl-sans, sans-serif); font-variant-numeric: tabular-nums; color: var(--pl-ink-2, #46534c); }
.snd-range {
  -webkit-appearance: none; appearance: none; flex: 1; width: auto; min-width: 0; height: 40px; min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; cursor: pointer; touch-action: pan-y; --p: 50%;
}
.snd-range:focus { background: transparent; }
.snd-range:disabled { cursor: not-allowed; }
.snd-range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--pl-brass, #dfaa3f) var(--p), #e3d8bd var(--p)); box-shadow: inset 0 1px 2px rgb(0 0 0 / .2); }
.snd-range::-moz-range-track { height: 10px; border-radius: 999px; background: #e3d8bd; box-shadow: inset 0 1px 2px rgb(0 0 0 / .2); }
.snd-range::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--pl-brass, #dfaa3f); }
.snd-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%; background: linear-gradient(#fffdf6, #f1e6cb);
  border: 2px solid var(--pl-brass-deep, #8c6012); box-shadow: 0 2px 4px rgb(0 0 0 / .35);
}
.snd-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fbf5e8; border: 2px solid var(--pl-brass-deep, #8c6012); box-shadow: 0 2px 4px rgb(0 0 0 / .35); }
.snd-range:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--pl-brass-deep, #8c6012); outline-offset: 2px; }

/* écouter */
.snd-test { display: flex; flex-direction: column; gap: .5rem; padding: 4px 2px 0; }
.snd-test > span { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pl-ink-3, #637068); }
.snd-test > div { display: flex; flex-wrap: wrap; gap: .45rem; }
.snd-chip {
  min-height: 44px; padding: .3rem 1rem; cursor: pointer; font-weight: 800; font-size: .92rem; color: var(--pl-ink, #1d2823); touch-action: manipulation;
  background: linear-gradient(#fffdf6, #f5ecd7); border: 1.5px solid var(--pl-edge, #d6c6a3); border-radius: 999px; box-shadow: 0 2px 0 var(--pl-edge-2, #bba97f);
}
.snd-chip:active { transform: translateY(2px); box-shadow: none; }

/* le bouton des réglages, à côté de ceux de l'appel (habillé par chaque jeu, comme eux) */
.snd-btn { cursor: pointer; }
.pl-screen > .snd-corner { position: absolute; top: calc(.9rem + env(safe-area-inset-top)); right: 16px; }

@media (prefers-reduced-motion: reduce) { .snd *, .snd *::before, .snd *::after { animation: none !important; transition: none !important; } }
.pl-screen.pl-home { position: relative; }
