[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
}

.error { color: var(--danger); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.login form { width: min(360px, 100%); }
.login-eye { width: 120px; height: 70px; }
.login .logo { font-size: 58px; margin-top: 6px; }
.login-sub { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .3em; text-transform: uppercase; color: #ffe3f1; margin-top: 8px; }
.login p { color: #eadcf7; margin: 8px 0 24px; }
.login p.error { color: var(--danger); margin: 12px 0 0; }
#code-input {
  display: block; width: 100%; text-align: center; text-transform: uppercase;
  font-family: var(--display); font-weight: 600; font-size: 52px; letter-spacing: .4em; padding: 8px 0 8px .4em;
  background: var(--panel); backdrop-filter: var(--glass); border: 2px solid var(--line); border-radius: var(--radius); outline: none;
}
#code-input:focus { border-color: var(--accent); }

.big-btn {
  display: block; width: 100%; margin-top: 16px; padding: 16px; border: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, #ff7cbd, var(--accent-deep)); box-shadow: 0 6px 18px rgba(224, 35, 127, .45); font-family: var(--display); font-weight: 600; font-size: 20px; cursor: pointer;
}
.big-btn:disabled { opacity: .5; }

/* ---------- En-tête ---------- */
.app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.me-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(30, 16, 72, .72); backdrop-filter: var(--glass); border-bottom: 1px solid var(--line);
}
.me-head .avatar { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px var(--c); }
.me-head .who { flex: 1; min-width: 0; }
.me-head .nm { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: .01em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-head .cash { text-align: right; }
.me-head .amt { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.me-head .amt.up { animation: flash-up 1.2s; }
.me-head .amt.down { animation: flash-down 1.2s; }
@keyframes flash-up { 30% { color: var(--ok); transform: scale(1.12); } }
@keyframes flash-down { 30% { color: var(--danger); transform: scale(1.12); } }

.pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.pill.ok { background: rgba(79, 227, 169, .16); color: var(--ok); }
.pill.warn { background: rgba(255, 179, 71, .18); color: var(--warn); }
.pill.danger { background: rgba(255, 79, 109, .18); color: var(--danger); }
.pill.accent { background: rgba(165, 139, 255, .22); color: #e2d6ff; }

/* ---------- Bandeau des annonces de l'écran ---------- */
.banner {
  --ov: var(--accent);
  margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--ov) 20%, rgba(44, 24, 104, .9)); backdrop-filter: var(--glass); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--ov) 60%, transparent);
  animation: drop .4s cubic-bezier(.2, .8, .2, 1);
}
.banner .b-title { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: .01em; color: color-mix(in srgb, var(--ov) 70%, #fff); }
.banner .b-text { margin-top: 2px; }
.banner .b-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.banner[data-kind=secret] { --ov: #4fe3a9; }
.banner[data-kind=echec], .banner[data-kind=buzz] { --ov: #ff4f6d; }
.banner[data-kind=indice] { --ov: #4fb3ff; }
.banner[data-kind=mission] { --ov: #ffb347; }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Contenu ---------- */
.view { padding: 4px 16px 16px; }
.view h2 { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: .01em; color: #ffd6ec; text-shadow: 0 2px 10px rgba(255, 79, 163, .4); margin: 20px 0 10px; }
.view h2:first-child { margin-top: 16px; }
.card { background: var(--panel); backdrop-filter: var(--glass); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.done { opacity: .6; }
.card .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .grow { flex: 1; }
.card h3 { margin: 0; font-size: 16px; }
.empty { color: var(--muted); text-align: center; padding: 24px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.intro { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* Texte masqué : un appui pour le lire, il se recache tout seul. */
.reveal { position: relative; display: block; width: 100%; margin: 10px 0 6px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(20, 10, 52, .45); text-align: left; cursor: pointer; }
.reveal .txt { filter: blur(9px); user-select: none; transition: filter .25s; }
.reveal .hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.reveal.show { border-style: solid; border-color: var(--accent); }
.reveal.show .txt { filter: none; }
.reveal.show .hint { display: none; }
.secret-text { font-size: 19px; font-weight: 800; line-height: 1.3; }
.brief-text { font-size: 16px; font-weight: 600; line-height: 1.45; white-space: pre-wrap; text-align: left; }
.secret-text::before { content: '«\00a0'; color: var(--accent); }
.secret-text::after { content: '\00a0»'; color: var(--accent); }

.money { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.neg { color: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.list li:last-child { border-bottom: 0; }
.list time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }

/* ---------- Buzz ---------- */
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.target { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel); backdrop-filter: var(--glass); cursor: pointer; font-weight: 700; font-size: 14px; }
.target .avatar { width: 48px; height: 48px; }
.target.on { border-color: var(--danger); background: rgba(255, 79, 109, .14); }
.target input { position: absolute; opacity: 0; pointer-events: none; }
textarea, .field input { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: var(--glass); resize: vertical; font-size: 16px; }
textarea:focus { outline: none; border-color: var(--accent); }
.field-label { display: block; font-weight: 700; margin: 14px 0 8px; }
.clue-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

.buzzer {
  display: grid; place-items: center; width: 180px; height: 180px; margin: 20px auto 8px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ff8a9b, #e11d48 45%, #881337 100%);
  box-shadow: 0 10px 0 #4c0519, 0 18px 40px rgba(225, 29, 72, .45), inset 0 -6px 18px rgba(0, 0, 0, .35);
  font-family: var(--display); font-weight: 700; font-size: 44px; letter-spacing: .02em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .08s, box-shadow .08s;
}
.buzzer:active { transform: translateY(8px); box-shadow: 0 2px 0 #4c0519, 0 8px 20px rgba(225, 29, 72, .45), inset 0 -6px 18px rgba(0, 0, 0, .35); }
.buzzer:disabled { filter: grayscale(.8) brightness(.6); }
.pending { text-align: center; border-color: var(--danger); animation: pend 1.6s infinite; }
.pending .big { font-family: var(--display); font-weight: 700; font-size: 36px; color: #fff; -webkit-text-stroke: .12em var(--danger); paint-order: stroke fill; letter-spacing: .01em; }
@keyframes pend { 50% { box-shadow: 0 0 0 6px rgba(255, 79, 109, .18); } }
.btn-line { display: inline-block; margin-top: 10px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-weight: 700; cursor: pointer; }

/* ---------- Confessionnal ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.bubble .t { white-space: pre-wrap; }
.bubble time { display: block; margin-top: 4px; font-size: 11px; opacity: .65; }
.bubble.voix { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--accent); border-bottom-left-radius: 4px; }
.bubble.voix .from { font-family: var(--display); font-weight: 600; letter-spacing: .03em; color: #e2d6ff; font-size: 15px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #8a5cff); border-bottom-right-radius: 4px; }
.bubble.new { animation: drop .5s; }
.composer { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0; background: linear-gradient(transparent, rgba(40, 16, 80, .9) 35%); }
.composer textarea { flex: 1; min-height: 48px; max-height: 140px; }
.composer button { flex: none; width: 56px; border: 0; border-radius: 12px; background: var(--accent); font-size: 22px; cursor: pointer; }

/* ---------- Maison ---------- */
.rank li .pos { font-family: var(--display); font-weight: 600; font-size: 20px; width: 24px; text-align: center; color: var(--muted); }
.rank li.first .pos { color: var(--gold); }
.rank li.mine { background: rgba(165, 139, 255, .14); border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.rank li.out { opacity: .45; }
.rank .nm { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secret-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.secret-grid .s { display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; background: var(--panel); backdrop-filter: var(--glass); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 22px; }
.secret-grid .s small { font-family: var(--font); font-size: 10px; color: var(--muted); }
.secret-grid .s.open { border-color: var(--ok); color: var(--ok); }

/* ---------- Navigation du bas ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(30, 16, 72, .88); border-top: 1px solid var(--line); backdrop-filter: var(--glass);
}
.bottom-nav button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.bottom-nav .ico { font-size: 22px; filter: grayscale(.6); }
.bottom-nav button.active { color: var(--text); }
.bottom-nav button.active .ico { filter: none; }
.badge { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; }

/* ---------- Divers ---------- */
.toasts { position: fixed; left: 16px; right: 16px; top: calc(80px + env(safe-area-inset-top)); z-index: 20; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 14px; background: #3a2282; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; animation: drop .3s; }
.toast.error { border-color: var(--danger); }
.toast.ok { border-color: var(--ok); }
.offline { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; padding: 8px 14px; border-radius: 99px; background: var(--danger); font-size: 13px; font-weight: 700; white-space: nowrap; }
.logout { display: block; margin: 24px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; cursor: pointer; }

/* ---------- Vote ---------- */
.vote-targets .target.on { border-color: var(--warn); background: rgba(255, 179, 71, .14); }
.voted { text-align: center; border-color: var(--accent); }
.voted .big { font-family: var(--display); font-weight: 700; font-size: 36px; color: #fff; -webkit-text-stroke: .12em var(--lavender); paint-order: stroke fill; letter-spacing: .01em; }
.voted .reveal { text-align: center; }
.banner[data-kind=vote], .banner[data-kind=depouillement] { --ov: #f59e0b; }
