/* ==========================================================================
   Poop War — stylesheet
   Mobile-first. Dark, playful, widget-inspired.
   ========================================================================== */

:root {
  --bg:            #140c1c;
  --bg-2:          #1d1229;
  --surface:       rgba(255, 255, 255, .055);
  --surface-2:     rgba(255, 255, 255, .09);
  --border:        rgba(255, 255, 255, .1);
  --text:          #f6f1fb;
  --text-dim:      #b3a6c4;
  --brand:         #a855f7;
  --brand-2:       #f97316;
  --good:          #34d399;
  --bad:           #fb7185;
  --radius:        20px;
  --radius-sm:     14px;
  --shadow:        0 18px 40px rgba(0, 0, 0, .45);
  --font:          "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

/* Any class rule carrying `display` would otherwise beat the UA's
   [hidden] { display: none }, leaving hidden screens painted on top. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 620px at 12% -8%,  rgba(168, 85, 247, .30), transparent 60%),
    radial-gradient(900px  560px at 92% 4%,   rgba(249, 115, 22, .22), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 55%, var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
button { font: inherit; }

/* ─────────────────────────────── Identity gate ─────────────────────────── */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.gate__inner { width: 100%; max-width: 440px; text-align: center; }

.gate__logo {
  font-size: 74px;
  line-height: 1;
  animation: bob 2.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}

.gate__title {
  margin-top: 10px;
  font-size: 42px;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fbbf24, var(--brand-2), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate__sub  { margin: 6px 0 26px; color: var(--text-dim); font-size: 17px; }
.gate__hint { margin-top: 22px; color: var(--text-dim); font-size: 12.5px; }

.gate__warn {
  margin: 0 0 20px;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  color: #fde68a;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: var(--radius-sm);
}

.gate__warn strong { display: block; margin-bottom: 3px; color: #fbbf24; }

.gate__choices { display: grid; gap: 14px; }

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.choice:hover  { background: var(--surface-2); border-color: rgba(255,255,255,.24); }
.choice:active { transform: scale(.98); }

.choice__emoji {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  flex: 0 0 auto;
  font-size: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.choice__name { display: block; font-size: 20px; font-weight: 700; }
.choice__meta { display: block; font-size: 13px; color: var(--text-dim); }

/* ──────────────────────────────── App shell ────────────────────────────── */

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.topbar__id { display: flex; align-items: center; gap: 12px; min-width: 0; }

.topbar__avatar {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  font-size: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.topbar__label { display: block; font-size: 11px; color: var(--text-dim); }
.topbar__name  { display: block; font-size: 17px; }
.topbar__lock  { flex: 0 0 auto; font-size: 15px; opacity: .5; cursor: help; }

/* ─────────────────────────────────── Tabs ──────────────────────────────── */

.tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tab {
  flex: 1;
  min-height: 44px;          /* cible tactile confortable, partout */
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.panel { display: none; }
.panel.is-active { display: block; animation: fade .22s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.daylabel {
  margin: 0 0 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ───────────────────────── Widgetable-style scoreboard ─────────────────── */

.widget {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  overflow: hidden;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.widget__side {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 14px 12px 10px;
  background: linear-gradient(150deg, #64748b, #334155);
  transition: background .45s ease;
}

/* Bottom-left: the header row is busy and the panel clips its own overflow. */
.widget__side.is-winning::after {
  content: "👑";
  position: absolute;
  bottom: 7px; left: 10px;
  font-size: 18px;
  animation: bob 2.4s ease-in-out infinite;
}

.widget__head { display: flex; align-items: center; gap: 7px; }

.widget__avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  font-size: 15px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .28);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}

.widget__count {
  margin-left: auto;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.widget__pooicon { font-size: 17px; opacity: .9; }

.widget__caption {
  margin: 7px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.widget__art {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 58px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .3));
}

.widget__art.is-pop { animation: pop .5s ease; }

@keyframes pop {
  0%   { transform: scale(.4) rotate(-18deg); opacity: 0; }
  60%  { transform: scale(1.18) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

.widget__who {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
}

.lead {
  margin: 14px 0 18px;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-dim);
}

.lead strong { color: var(--text); }

/* ─────────────────────────────── Buttons ───────────────────────────────── */

.actions { display: grid; gap: 10px; }

.actions__note {
  margin: 2px 0 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;          /* cible tactile confortable, partout */
  padding: 13px 18px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s ease, background .16s ease, opacity .16s ease;
}

.btn:hover:not(:disabled)  { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(168, 85, 247, .3);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(120deg, #b46bfa, #fb8a3c);
}

.btn--xl { padding: 18px; font-size: 18px; }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--bad); border-color: rgba(251, 113, 133, .35); }

.iconbtn {
  width: 40px; height: 40px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.iconbtn:hover { color: var(--text); background: var(--surface-2); }

/* ──────────────────────────────── Blocks ───────────────────────────────── */

.block {
  margin-top: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.block__head h2 { font-size: 16px; }

.pill {
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 999px;
}

.muted { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--text-dim); }

/* ───────────────────────────────── Feed ────────────────────────────────── */

.feed, .history { margin: 0; padding: 0; list-style: none; }

.feed__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.feed__item:first-child { border-top: 0; }

.feed__emoji {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: 0 0 auto;
  font-size: 21px;
  border-radius: 12px;
}

.feed__main { flex: 1; min-width: 0; }
.feed__title { font-size: 14.5px; font-weight: 600; }
.feed__meta  { font-size: 12px; color: var(--text-dim); }
.feed__note  { margin-top: 2px; font-size: 12.5px; font-style: italic; color: var(--text-dim); }

.feed__del {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;   /* cible tactile, sans dependre de pointer:coarse */
  flex: 0 0 auto;
  padding: 6px 8px;
  font-size: 14px;
  color: var(--text-dim);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.feed__del:hover { color: var(--bad); background: rgba(251, 113, 133, .1); }

.empty {
  padding: 20px 6px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* ─────────────────────────────── Type grid ─────────────────────────────── */

.typegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  max-height: 46vh;
  margin-bottom: 14px;
  overflow-y: auto;
  padding: 2px;
}

.typecard {
  padding: 12px 8px;
  text-align: center;
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}

.typecard:hover  { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .35); }
.typecard:active { transform: scale(.96); }

.typecard__emoji { display: block; font-size: 30px; line-height: 1.1; }
.typecard__name  { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 700; }
.typecard__desc  { display: block; margin-top: 2px; font-size: 10.5px; opacity: .85; line-height: 1.3; }

.notefield { display: block; font-size: 12.5px; color: var(--text-dim); }

.notefield input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
}

.notefield input:focus { border-color: var(--brand); }

/* ─────────────────────────────── Verdict ───────────────────────────────── */

.verdict { text-align: center; }
.verdict__crown { font-size: 44px; line-height: 1; }
.verdict__title { margin: 6px 0 4px; font-size: 20px; }
.verdict__score { font-size: 14px; color: var(--text-dim); }
.verdict__note  { margin: 12px 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }

.card {
  margin: 14px 0;
  padding: 18px;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(168, 85, 247, .3), rgba(249, 115, 22, .22));
  border: 1px solid rgba(255, 255, 255, .16);
}

.card__kind {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.card__text { margin-top: 8px; font-size: 17px; line-height: 1.45; font-weight: 600; }

.choicepair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }

.bigchoice {
  padding: 22px 10px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .14s ease;
}

.bigchoice:active { transform: scale(.96); }
.bigchoice--truth { background: linear-gradient(140deg, #0ea5e9, #6366f1); }
.bigchoice--dare  { background: linear-gradient(140deg, #f97316, #ef4444); }
.bigchoice small  { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; opacity: .85; }

/* ─────────────────────────── Notifications WhatsApp ────────────────────── */

.notify__row {
  margin-bottom: 12px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.notify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.notify__who { font-size: 14.5px; font-weight: 700; }
.notify__who em { font-style: normal; font-weight: 500; color: var(--text-dim); }

.notify__state { font-size: 11.5px; color: var(--text-dim); }
.notify__state.is-ok   { color: var(--good); }
.notify__state.is-warn { color: #fbbf24; }

.notify__preview {
  margin: 9px 0 11px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;      /* les messages contiennent de vrais sauts de ligne */
  color: var(--text-dim);
  background: rgba(0, 0, 0, .22);
  border-radius: 10px;
}

.btn--block { width: 100%; }

.notify__hint {
  margin: 4px 0 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ─────────────────────────────── History ───────────────────────────────── */

.history__item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.history__item:first-child { border-top: 0; }

.history__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.history__day { font-size: 14.5px; font-weight: 600; text-transform: capitalize; }
.history__score { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.history__meta { margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }
.history__card { margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.history__card b { color: var(--text); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.tag--open { color: #fbbf24; background: rgba(251, 191, 36, .14); }

/* ──────────────────────────────── Stats ────────────────────────────────── */

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.statcard {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.statcard__who { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.statcard__big { margin: 8px 0 2px; font-size: 30px; font-weight: 800; line-height: 1; }
.statcard__lbl { font-size: 11.5px; color: var(--text-dim); }

.statline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.statline b { color: var(--text); font-weight: 700; }

.datarow { display: flex; flex-wrap: wrap; gap: 10px; }
.datarow .btn { flex: 1 1 auto; }

.credits {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ──────────────────────────────── Modals ───────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}


.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 14, .72);
  backdrop-filter: blur(4px);
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  background: #211533;
  border: 1px solid var(--border);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow);
  animation: slideup .26s cubic-bezier(.2, .8, .3, 1);
}

@keyframes slideup { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 620px) {
  .modal { place-items: center; }
  .modal__box { border-radius: 26px; }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.modal__head h2 { font-size: 19px; }
.modal__sub { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }

/* ──────────────────────────────── Toast ───────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 12, 28, .95);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: slideup .2s ease;
}


@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Ajouts : landing page multi-joueurs, connexion, responsive
   ========================================================================== */

/* ───────────────────────────── Landing page ────────────────────────────── */

.choice__text { min-width: 0; }          /* laisse le texte se tronquer */

.choice__name,
.choice__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate__add { margin-top: 14px; }

/* ──────────────────────────── Formulaires ──────────────────────────────── */

.fieldlabel {
  margin: 16px 0 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.fieldhelp {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.formerror {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  color: #fecaca;
  background: rgba(239, 68, 68, .14);
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 12px;
}

.notefield input:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Grille d'avatars du nouveau joueur */
.avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.avatar {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.avatar:hover  { background: var(--surface-2); }
.avatar:active { transform: scale(.92); }

.avatar.is-on {
  background: rgba(168, 85, 247, .28);
  border-color: var(--brand);
  transform: scale(1.06);
}

.modal__box--narrow { max-width: 420px; }

/* ───────────────────── Scoreboard à N joueurs ──────────────────────────── */

/* Deux joueurs : côte à côte, comme le widget d'origine.
   Trois et plus : deux colonnes — au-delà, les panneaux deviennent trop
   étroits sur un téléphone pour que le compteur reste lisible. */
.widget--many {
  grid-template-columns: repeat(2, 1fr);
}

/* Nombre impair : le dernier panneau prend toute la largeur au lieu de
   laisser un trou dans la grille. */
.widget--many > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.widget--many .widget__side { min-height: 168px; }
.widget--many .widget__art  { font-size: 46px; }

/* ============================== RESPONSIVE ==============================
   L'app est pensée mobile d'abord ; ces paliers gèrent les extrêmes.
   ======================================================================== */

/* Petits téléphones (iPhone SE, Android compacts : 320–380 px) */
@media (max-width: 380px) {
  .app { padding: 14px 12px 32px; }

  .gate { padding: 20px 14px; }
  .gate__logo  { font-size: 60px; }
  .gate__title { font-size: 34px; }
  .gate__sub   { font-size: 15px; margin-bottom: 20px; }
  .gate__warn  { font-size: 12px; padding: 12px 13px; }

  .choice { padding: 14px; gap: 12px; }
  .choice__emoji { width: 46px; height: 46px; font-size: 24px; }
  .choice__name  { font-size: 18px; }

  .tab { font-size: 12.5px; padding: 9px 4px; }   /* min-height 44px conservé */

  .widget { border-radius: 20px; }
  .widget__side  { min-height: 168px; padding: 11px 9px 8px; }
  .widget__count { font-size: 25px; }
  .widget__art   { font-size: 46px; }
  .widget__caption { font-size: 12px; }
  .widget__avatar { width: 26px; height: 26px; font-size: 13px; }
  .widget__who { font-size: 10px; }

  .btn      { padding: 12px 14px; }
  .btn--xl  { padding: 15px; font-size: 16px; }

  .block { padding: 13px; }

  .feed__emoji { width: 38px; height: 38px; font-size: 19px; }
  .feed__title { font-size: 13.5px; }

  /* Deux colonnes de stats deviennent illisibles sous 380 px. */
  .statgrid { grid-template-columns: 1fr; }

  .typegrid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .typecard__name { font-size: 11.5px; }
  .typecard__desc { font-size: 10px; }

  .avatars { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }

  .modal__box { padding: 17px 14px calc(20px + env(safe-area-inset-bottom)); }
  .modal__head h2 { font-size: 17px; }

  /* Empilé : deux boutons côte à côte sont trop étroits pour le pouce. */
  .choicepair { grid-template-columns: 1fr; }
  .datarow .btn { flex: 1 1 100%; }
}

/* Téléphone en paysage : la hauteur devient la ressource rare. */
@media (max-height: 480px) and (orientation: landscape) {
  .gate { min-height: auto; padding: 18px 14px; }
  .gate__logo { font-size: 44px; }
  .gate__title { font-size: 30px; }
  .gate__warn { display: none; }        /* déjà rappelé par la confirmation */

  .widget__side { min-height: 140px; }
  .widget__art  { font-size: 40px; }

  .modal__box { max-height: 96dvh; }
}

/* Tablette et desktop : on aère, sans jamais s'étaler. */
@media (min-width: 700px) {
  .app { max-width: 620px; padding-top: 26px; }
  /* Plus de largeur : trois colonnes redeviennent confortables. */
  .widget--many { grid-template-columns: repeat(3, 1fr); }
  .widget--many > :last-child:nth-child(odd) { grid-column: auto; }
  .widget--many > :last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  .typegrid { max-height: 52vh; }
}

/* Confort tactile : toute cible cliquable fait au moins ~44 px de haut.
   Exclut les cases d'avatar, déjà carrées et suffisamment grandes. */
@media (pointer: coarse) {
  .btn, .tab, .choice, .typecard, .bigchoice { min-height: 44px; }
  .feed__del { min-width: 40px; min-height: 40px; }
  .iconbtn { width: 40px; height: 40px; }
}

/* ─────────────────────────── Badge de synchro ──────────────────────────── */

.syncbadge {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s ease;
}

.syncbadge:hover  { background: var(--surface-2); }
.syncbadge:active { transform: scale(.94); }

/* ─────────────────────────────── Zone rouge ────────────────────────────── */

.block--danger {
  background: rgba(239, 68, 68, .07);
  border-color: rgba(239, 68, 68, .3);
}

.block--danger .block__head h2 { color: #fca5a5; }

/* ─────────────────────────────── Preuve photo ──────────────────────────── */

.proof { margin-bottom: 16px; }

.proof__preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: rgba(0, 0, 0, .25);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.proof__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof__empty {
  text-align: center;
  font-size: 28px;
  line-height: 1.5;
  color: var(--text-dim);
}

.proof__empty small { font-size: 12px; }

.proof__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.proof__actions .btn { flex: 1 1 auto; }

.proof__hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* Tant qu'il n'y a pas de preuve, les types restent hors d'atteinte —
   visibles, pour donner envie, mais non cliquables. */
.typegrid.is-locked {
  opacity: .4;
  filter: grayscale(.6);
}

.typegrid.is-locked .typecard { cursor: not-allowed; }

/* Vignette dans le journal du jour */
.feed__proof {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.feed__proof img { width: 100%; height: 100%; object-fit: cover; display: block; }

.feed__proof--none {
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  background: rgba(255, 255, 255, .04);
}

/* ────────────────────── Visionneuse de preuve (lightbox) ───────────────── */

/* Plein écran centré, contrairement aux autres modales qui remontent du bas :
   une photo doit occuper la place disponible, pas une feuille de contenu. */
.modal--proof { place-items: center; }

.proofview {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100% - 24px, 560px);
  max-height: min(88dvh, 780px);
  overflow: hidden;
  background: #211533;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideup .24s cubic-bezier(.2, .8, .3, 1);
}

.proofview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.proofview__who { display: flex; align-items: center; gap: 10px; min-width: 0; }

.proofview__emoji {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  font-size: 19px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.proofview__title {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.proofview__meta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-dim);
}

.proofview__body {
  display: grid;
  place-items: center;
  min-height: 0;              /* sans ça, l'image déborde du conteneur flex */
  padding: 12px;
  background: rgba(0, 0, 0, .35);
}

.proofview__body img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;        /* la preuve entière, jamais rognée */
  border-radius: 10px;
}

/* Le bouton vignette : neutraliser le style par défaut des <button> */
.feed__proof {
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform .14s ease, border-color .16s ease;
}

.feed__proof:hover  { border-color: rgba(255, 255, 255, .3); }
.feed__proof:active { transform: scale(.94); }

/* La corbeille n'apparaît que sur ses propres lignes. Sans réserver la place,
   les vignettes de preuve ne s'alignent pas d'une ligne à l'autre. */
.feed__del {
  width: 32px;
  flex: 0 0 auto;
  text-align: center;
}

.feed__del--ghost { visibility: hidden; }

/* ═══════════════════════════════ Onglet Admin ═════════════════════════════ */

.tab--admin.is-active {
  background: linear-gradient(120deg, #ef4444, var(--brand-2));
}

/* ───────────────────────────── Liste des joueurs ───────────────────────── */

.adminlist { margin: 0; padding: 0; list-style: none; }

.adminlist__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.adminlist__item:first-child { border-top: 0; }

.adminlist__emoji {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  font-size: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.adminlist__main { flex: 1; min-width: 0; }
.adminlist__name { display: block; font-size: 14.5px; font-weight: 600; }

.adminlist__name em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fca5a5;
}

.adminlist__meta { display: block; font-size: 12px; color: var(--text-dim); }
.adminlist__lock { flex: 0 0 auto; font-size: 15px; opacity: .5; cursor: help; }

/* ─────────────────────── Journal complet des preuves ───────────────────── */

.prooflist__day { margin-bottom: 18px; }
.prooflist__day:last-child { margin-bottom: 0; }

.prooflist__date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.prooflist__date span {
  padding: 2px 9px;
  font-size: 11px;
  letter-spacing: 0;
  background: var(--surface-2);
  border-radius: 999px;
}

.prooflist { margin: 0; padding: 0; list-style: none; }

.prooflist__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.prooflist__item:first-child { border-top: 0; }

.prooflist__thumb {
  display: block;
  width: 54px; height: 54px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .14s ease, border-color .16s ease;
}

.prooflist__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prooflist__thumb:hover  { border-color: rgba(255, 255, 255, .3); }
.prooflist__thumb:active { transform: scale(.94); }

.prooflist__thumb--none {
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 14px;
  background: rgba(255, 255, 255, .04);
  cursor: default;
}

.prooflist__main { flex: 1; min-width: 0; }
.prooflist__who  { display: block; font-size: 14px; font-weight: 600; }
.prooflist__meta { display: block; font-size: 12px; color: var(--text-dim); }

.prooflist__note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
}
