/* ===== Base commune : jetons de la Boîte de Jambon (utilisés par ham-box.css), boutons .btn des jeux, appel vocal. L'accueil et le salon sont dans platform.css. ===== */
:root {
  --ink: #3a1d17;          /* texte */
  --ink-2: #6b4a3f;        /* texte secondaire (≥ 7:1 sur crème) */
  --ink-3: #8a6a5e;        /* indications discrètes (≥ 4.5:1 sur blanc) */
  --paper: #fff;
  --cream: #fffaf3;
  --line: #f3dccb;
  --line-2: #ecc8b2;
  --ham: #ef7f93;
  --ham-deep: #c94a64;
  --gold: #f5b53f;
  --gold-deep: #c98a1e;
  --good: #2e9a5b;
  --good-deep: #1f7a45;
  --bad: #d9443f;
  --bad-deep: #b0302c;
  --sh: 120 50 30;
  --font: "Fredoka", "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); }
body {
  font-family: var(--font-body);
  line-height: 1.45;
  min-height: 100dvh;
  background: radial-gradient(ellipse 110% 70% at 50% 0%, #fffaf2 0%, #ffead9 45%, #ffd6c3 80%, #fcc0ad 100%) fixed;
  -webkit-tap-highlight-color: transparent;
}
/* rayons de soleil derrière le titre */
body::before {
  content: ''; position: fixed; left: 50%; top: 120px; width: 260vmax; height: 260vmax; z-index: -1; pointer-events: none;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgb(255 255 255 / .38) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 38%); mask: radial-gradient(circle, #000 0, transparent 38%);
}
body.in-game { overflow: hidden; overscroll-behavior: none; }
h1, h2, h3 { margin: 0 0 .5rem; font-family: var(--font); font-weight: 600; letter-spacing: .005em; }
h1 { font-size: 2.4rem; line-height: 1.05; }
h2 { font-size: 1.15rem; }
button { font-family: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { text-align: center; }
em { color: var(--ink-2); font-style: normal; font-size: .88em; }
.icon { width: 1.15em; height: 1.15em; flex: none; display: block; }

.conn {
  position: sticky; top: 0; z-index: 100; color: #fff; background: var(--bad-deep); text-align: center; padding: .45rem;
  font-size: .9rem; font-weight: 700;
}
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translate(-50%, 200%);
  background: var(--ink); color: #fff; font-weight: 600; padding: .7rem 1.2rem; border-radius: 999px;
  box-shadow: 0 12px 30px -8px rgb(var(--sh) / .6); transition: transform .25s cubic-bezier(.2, .9, .3, 1);
  z-index: 200; max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

.screen {
  max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top)) 16px calc(2rem + env(safe-area-inset-bottom));
}

/* ---- boutons (pâte à modeler) ---- */
.btn {
  font: inherit; font-family: var(--font); font-weight: 600; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px;
  padding: .6rem 1.1rem; background: var(--paper); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 0 var(--line-2); transition: transform .1s, box-shadow .1s, background .15s;
}
.btn:hover:not(:disabled) { background: #fff8f2; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); }
.btn:focus-visible, .game-tile:focus-visible, input:focus-visible { outline: 3px solid var(--ham-deep); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary, .btn.primary:hover:not(:disabled) {
  color: #fff; background: linear-gradient(#f4889b, var(--ham-deep)); border-color: #ffb9c4;
  box-shadow: 0 4px 0 #9e3249, 0 12px 22px -8px rgb(201 74 100 / .6); text-shadow: 0 1px 0 rgb(0 0 0 / .15);
}
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 #9e3249; }
.btn.gold, .btn.gold:hover:not(:disabled) {
  color: var(--ink); background: linear-gradient(#ffe48a, var(--gold)); border-color: #fff0bf;
  box-shadow: 0 4px 0 var(--gold-deep), 0 10px 18px -8px rgb(var(--sh) / .5);
}
.btn.gold:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-deep); }
.btn.big { min-height: 56px; padding: .8rem 1rem; font-size: 1.15rem; width: 100%; border-radius: 18px; }
.btn.small { min-height: 40px; padding: .35rem .8rem; font-size: .92rem; border-radius: 12px; box-shadow: 0 3px 0 var(--line-2); }
.btn.ghost { background: transparent; border-color: rgb(58 29 23 / .15); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: rgb(255 255 255 / .6); }
.btn.ghost:active:not(:disabled) { transform: scale(.98); box-shadow: none; }
.btn.link {
  min-height: 44px; background: none; border: 0; box-shadow: none; color: var(--ink-2); font-family: var(--font-body);
  font-weight: 700; font-size: .92rem; text-decoration: underline; text-decoration-color: rgb(58 29 23 / .25); text-underline-offset: 3px;
}
.btn.link:hover:not(:disabled) { background: none; color: var(--ink); }
.btn.link:active:not(:disabled) { transform: none; box-shadow: none; }

input {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--cream); border: 2px solid var(--line);
  border-radius: 14px; padding: .75rem .95rem; width: 100%; min-height: 50px; font-size: 1rem;
  transition: border-color .15s, background .15s;
}
input::placeholder { color: var(--ink-3); font-weight: 400; }
input:focus { outline: none; border-color: var(--ham); background: #fff; }

/* ---- panneaux ---- */
.panel {
  background: var(--paper); border-radius: 24px; padding: 1.1rem; display: flex; flex-direction: column; gap: .85rem;
  box-shadow: 0 4px 0 rgb(var(--sh) / .1), 0 18px 40px -16px rgb(var(--sh) / .45);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: .45rem; }
.panel-head h2 .icon { color: var(--ham-deep); }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: var(--ink-2); background: #fff3e8;
}


/* ---- appel vocal / vidéo (voice.js) ---- */
.voice-sink { position: fixed; width: 0; height: 0; overflow: hidden; }
.voice-bar { display: flex; align-items: center; gap: 5px; }
.vb {
  position: relative; flex: none; min-width: 40px; height: 40px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font: inherit; font-size: .88rem; font-weight: 800; color: var(--ink); cursor: pointer; touch-action: manipulation;
  background: #fff; border: 0; border-radius: 13px; box-shadow: 0 3px 0 rgb(var(--sh) / .18), 0 8px 16px -6px rgb(var(--sh) / .4);
  transition: transform .1s, box-shadow .1s, background .2s, color .2s;
}
.vb .icon { width: 21px; height: 21px; }
.vb:active { transform: translateY(2px); box-shadow: 0 1px 0 rgb(var(--sh) / .18); }
.vb:focus-visible { outline: 3px solid var(--ham-deep); outline-offset: 2px; }
.vb.off { color: #fff; background: #8a7a74; }
.vb.on.talk { box-shadow: 0 0 0 3px #2fbf71, 0 3px 0 rgb(var(--sh) / .18); }
.vb.hang { color: #fff; background: var(--bad); }
.vb.join.live { color: #fff; background: #2fbf71; box-shadow: 0 3px 0 #1f8a51, 0 8px 16px -6px rgb(var(--sh) / .4); }
.vb.busy { opacity: .6; cursor: progress; }
.vb-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center;
  font-size: .72rem; color: #fff; background: var(--ham-deep); border: 2px solid #fff;
}
/* l'image de la caméra d'un joueur */
.cam-bubble { display: none; overflow: hidden; background: #2b2220; pointer-events: none; }
.cam-bubble.on { display: block; }
.cam-bubble video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-bubble.self video { transform: scaleX(-1); } /* ma propre image, comme dans un miroir */
