/* Le Café des musiciens : page plein écran au-dessus de la scène 3D (assets/js/cafe.js). */
:root {
  --bg: #120D0B;
  --glass: rgba(24, 17, 14, .78);
  --glass-2: rgba(36, 26, 21, .9);
  --line: rgba(255, 232, 200, .1);
  --line-2: rgba(255, 232, 200, .18);
  --ink: #F8F1E7;
  --ink-2: #D9CBBA;
  --muted: #A49482;
  --gold: #F8C25C;
  --gold-2: #F4A63A;
  --grad-gold: linear-gradient(180deg, #FFD683 0%, #F4AB3F 100%);
  --wa: #25D366;
  --danger: #FF6B6B;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Outfit", "DM Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
[hidden] { display: none !important; }

.cafe { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.cafe input, .cafe textarea, .cafe select { user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.cafe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; }
.cafe-canvas.is-hover { cursor: pointer; }
.cafe-canvas.is-drag { cursor: grabbing; }

/* Étiquettes et bulles au-dessus des musiciens */
.cafe-labels { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.cafe-tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); will-change: transform; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cafe-tag-name { font: 600 12px/1 var(--display); padding: 4px 8px 4px 6px; border-radius: 999px; background: rgba(14, 10, 8, .72); border: 1px solid rgba(255, 255, 255, .1); white-space: nowrap; display: flex; align-items: center; gap: 5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cafe-tag-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold)); box-shadow: 0 0 6px var(--c, var(--gold)); }
.cafe-tag-name em { font-style: normal; font-size: 10px; color: var(--gold); }
.cafe-tag.is-me .cafe-tag-name { border-color: rgba(248, 194, 92, .45); }
.cafe-bubble { max-width: 220px; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: rgba(255, 249, 240, .96); color: #24170F; font-size: 13px; line-height: 1.3; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); animation: cafe-pop .25s var(--ease); overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cafe-bubble.is-table { background: #FFE6B3; }
.cafe-bubble.is-dm { background: #D9F7E3; }
.cafe-tag.is-far .cafe-bubble { display: none; }
.cafe-tag.is-far .cafe-tag-name { opacity: .75; font-size: 11px; }
@keyframes cafe-pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }

/* Chargement */
.cafe-loader { position: absolute; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle at 50% 40%, #2A1C14 0%, #120D0B 70%); transition: opacity .6s var(--ease), visibility .6s; text-align: center; padding: 20px; }
.cafe-loader b { font: 700 22px/1.1 var(--display); }
.cafe-loader small { color: var(--muted); }
.cafe-loader.is-done { opacity: 0; visibility: hidden; }
.cafe-loader-slow { max-width: 300px; margin-top: 8px; }
.cafe-loader-cup { position: relative; width: 64px; height: 50px; border-radius: 0 0 22px 22px; background: var(--grad-gold); margin-top: 34px; box-shadow: 0 10px 30px rgba(248, 180, 80, .3); }
.cafe-loader-cup::after { content: ""; position: absolute; right: -16px; top: 8px; width: 20px; height: 22px; border: 5px solid #F4AB3F; border-left: 0; border-radius: 0 12px 12px 0; }
.cafe-loader-cup span { position: absolute; bottom: 100%; width: 6px; height: 22px; border-radius: 6px; background: rgba(255, 240, 220, .5); filter: blur(2px); animation: cafe-steam 1.8s ease-in-out infinite; }
.cafe-loader-cup span:nth-child(1) { left: 14px; }
.cafe-loader-cup span:nth-child(2) { left: 29px; animation-delay: .4s; }
.cafe-loader-cup span:nth-child(3) { left: 44px; animation-delay: .8s; }
@keyframes cafe-steam { 0% { transform: translateY(6px) scaleY(.6); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-14px) scaleY(1.1); opacity: 0; } }

/* Barre du haut */
.cafe-top { position: absolute; z-index: 20; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.cafe-top > * { pointer-events: auto; }
.cafe-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-decoration: none; color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.cafe-logo { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-gold); font-size: 16px; }
.cafe-brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.cafe-brand-txt b { font: 700 15px/1 var(--display); }
.cafe-brand-txt small { font-size: 11px; color: var(--muted); }
.cafe-online { padding: 0 14px; font-size: 13px; color: var(--ink-2); }
.cafe-online i { width: 8px; height: 8px; border-radius: 50%; background: #3DD68C; box-shadow: 0 0 0 3px rgba(61, 214, 140, .2); animation: cafe-pulse 2s infinite; }
@keyframes cafe-pulse { 50% { box-shadow: 0 0 0 6px rgba(61, 214, 140, 0); } }
.cafe-top-actions { margin-left: auto; display: flex; gap: 8px; }

.cafe-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .15s var(--ease), background .2s, border-color .2s; white-space: nowrap; }
.cafe-btn:hover { border-color: rgba(248, 194, 92, .5); }
.cafe-btn:active { transform: scale(.96); }
.cafe-btn:focus-visible, .cafe-send:focus-visible, .cafe-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cafe-btn-icon { width: 44px; padding: 0; font-size: 16px; }
.cafe-btn-gold { background: var(--grad-gold); color: #241505; border-color: transparent; box-shadow: 0 8px 22px rgba(248, 180, 80, .28); }
.cafe-btn-gold:hover { border-color: transparent; filter: brightness(1.05); }
.cafe-btn-wa { background: var(--wa); color: #06210F; border-color: transparent; }
.cafe-btn-lg { width: 100%; min-height: 52px; font-size: 16px; }
.cafe-btn[disabled] { opacity: .55; pointer-events: none; }
.cafe-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #FF4F79; box-shadow: 0 0 0 2px var(--bg); }
.cafe-link-btn { background: none; border: 0; padding: 6px; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.cafe-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-2); z-index: 2; }
.cafe-x:hover { color: var(--ink); background: rgba(255, 255, 255, .1); }

.cafe-notice { position: absolute; z-index: 19; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100% - 20px)); display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 14px; border-radius: 14px; background: rgba(248, 194, 92, .16); border: 1px solid rgba(248, 194, 92, .4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13.5px; }
.cafe-notice button { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .25); cursor: pointer; }

.cafe-guest { position: absolute; z-index: 19; bottom: calc(12px + var(--safe-b)); right: 12px; width: min(600px, calc(100% - 416px)); display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--glass-2); border: 1px solid rgba(248, 194, 92, .3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.cafe-guest > span { font-size: 24px; }
.cafe-guest div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cafe-guest small { color: var(--ink-2); font-size: 12.5px; }
@media (max-width: 1000px) { .cafe-guest { bottom: auto; right: auto; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 20px)); } }

/* Action contextuelle et toast */
.cafe-action { position: absolute; z-index: 18; left: calc(196px + 50%); bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--grad-gold); color: #241505; font-weight: 700; font-size: 15px; box-shadow: 0 10px 28px rgba(248, 180, 80, .35); cursor: pointer; animation: cafe-pop .25s var(--ease); }
.cafe-toast { position: absolute; z-index: 70; left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%); max-width: calc(100% - 24px); padding: 11px 16px; border-radius: 14px; background: rgba(255, 249, 240, .97); color: #24170F; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: cafe-pop .25s var(--ease); text-align: center; }
.cafe-toast.is-err { background: #FFE1E1; color: #5A0D0D; }

/* Chat */
.cafe-chat { position: absolute; z-index: 15; left: 12px; bottom: calc(12px + var(--safe-b)); width: 380px; height: min(440px, calc(100% - 100px)); display: flex; flex-direction: column; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); overflow: hidden; transition: height .3s var(--ease); }
.cafe-chat-bar { display: none; }
.cafe-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cafe-tabs { display: flex; gap: 6px; padding: 10px 10px 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.cafe-tabs::-webkit-scrollbar { display: none; }
.cafe-tabs button { position: relative; flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.cafe-tabs button.is-on { background: rgba(248, 194, 92, .16); border-color: rgba(248, 194, 92, .5); color: var(--gold); }
.cafe-tabs button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold)); }
.cafe-tabs button b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #FF4F79; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.cafe-tabs button .cafe-tab-x { font-size: 15px; margin-left: 2px; opacity: .6; }
.cafe-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.cafe-msg { display: flex; gap: 8px; align-items: flex-start; }
.cafe-msg-av { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--c, var(--gold)); color: #1a120c; font: 700 12px/26px var(--display); text-align: center; cursor: pointer; }
.cafe-msg-main { min-width: 0; flex: 1; }
.cafe-msg-head { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.cafe-msg-head b { color: var(--ink); cursor: pointer; }
.cafe-msg-head time { color: var(--muted); font-size: 11px; }
.cafe-msg-head .cafe-staff { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: rgba(248, 194, 92, .18); color: var(--gold); }
.cafe-msg-text { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.cafe-msg-text a { color: var(--gold); }
.cafe-msg-flag { margin-left: auto; opacity: 0; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 0 2px; }
.cafe-msg:hover .cafe-msg-flag { opacity: 1; }
.cafe-msg.is-me .cafe-msg-text { color: var(--ink); }
.cafe-msgs-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
.cafe-msgs-hint { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.cafe-say { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.cafe-say input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); font-size: 16px; outline: none; }
.cafe-say input:focus { border-color: var(--gold); }
.cafe-send { flex: 0 0 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad-gold); color: #241505; font-size: 17px; cursor: pointer; }
.cafe-say-guest { padding: 12px; text-align: center; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }

/* Fiche d'un musicien */
.cafe-card { position: absolute; z-index: 30; right: 12px; top: calc(66px + var(--safe-t)); width: 340px; max-height: calc(100% - 90px); overflow-y: auto; padding: 18px; border-radius: 22px; background: var(--glass-2); border: 1px solid var(--line-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: cafe-pop .25s var(--ease); }
.cafe-card-head { display: flex; gap: 12px; align-items: center; padding-right: 36px; }
.cafe-card-head b { font: 700 19px/1.15 var(--display); display: block; }
.cafe-card-head small { color: var(--muted); font-size: 12.5px; }
.cafe-avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--c, var(--gold)) center/cover no-repeat; display: grid; place-items: center; font: 700 22px var(--display); color: #1a120c; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.cafe-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.cafe-roles span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 12.5px; }
.cafe-card-bio { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.cafe-card-bio:empty { display: none; }
.cafe-card-ads { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.cafe-card-ads:empty { display: none; }
.cafe-card-ads button { text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(248, 194, 92, .07); font-size: 13px; cursor: pointer; }
.cafe-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.cafe-card-actions > :only-child, .cafe-card-actions > :first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.cafe-card .cafe-link-btn { display: block; margin: 10px auto 0; }

/* Annonces */
.cafe-drawer { position: absolute; z-index: 35; top: 0; right: 0; bottom: 0; width: 420px; display: flex; flex-direction: column; background: rgba(22, 16, 13, .96); border-left: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: -20px 0 50px rgba(0, 0, 0, .5); animation: cafe-slide .3s var(--ease); padding-top: var(--safe-t); }
@keyframes cafe-slide { from { transform: translateX(40px); opacity: 0; } }
.cafe-drawer-head { position: relative; padding: 18px 60px 8px 18px; }
.cafe-drawer-head h2 { margin: 0; font: 700 21px/1.2 var(--display); }
.cafe-cats { display: flex; gap: 6px; padding: 6px 18px 10px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.cafe-cats::-webkit-scrollbar { display: none; }
.cafe-cats button { flex: 0 0 auto; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.cafe-cats button.is-on { background: rgba(248, 194, 92, .16); border-color: rgba(248, 194, 92, .5); color: var(--gold); }
.cafe-drawer-tools { display: flex; gap: 8px; padding: 0 18px 12px; }
.cafe-drawer-tools .cafe-btn { min-height: 40px; font-size: 13.5px; }
.cafe-ad-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.cafe-ad { position: relative; padding: 14px 14px 12px; border-radius: 16px; background: #FBF3E4; color: #2A1B10; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.cafe-ad::before { content: ""; position: absolute; top: -5px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FF8A8A, #C9302C); box-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.cafe-ad:nth-child(3n+2) { background: #FFF1B8; }
.cafe-ad:nth-child(3n) { background: #E5F1FF; }
.cafe-ad-cat { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8A5A1E; }
.cafe-ad h3 { margin: 4px 0 4px; font: 700 16px/1.25 var(--display); color: #21140B; }
.cafe-ad p { margin: 0 0 8px; font-size: 13.5px; color: #4A3826; white-space: pre-wrap; overflow-wrap: anywhere; }
.cafe-ad-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: #6B5540; align-items: center; }
.cafe-ad-meta b { color: #21140B; font-size: 14px; }
.cafe-ad-who { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, .2); }
.cafe-ad-who i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cafe-ad-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cafe-ad-actions .cafe-btn { min-height: 36px; padding: 0 12px; font-size: 13px; backdrop-filter: none; background: rgba(0, 0, 0, .78); color: #fff; border-color: transparent; }
.cafe-ad-actions .cafe-btn-wa { background: var(--wa); color: #06210F; }
.cafe-ad-actions .cafe-link-btn { color: #7A6650; margin-left: auto; }
.cafe-ad-state { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: rgba(0, 0, 0, .08); }
.cafe-ad-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.cafe-ad-form { flex: 1; overflow-y: auto; padding: 0 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; touch-action: pan-y; }
.cafe-ad-form h3 { margin: 0; font: 700 17px var(--display); }

/* Formulaires */
.cafe label, .cafe legend { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cafe label > span, .cafe legend > span { font-weight: 400; color: var(--muted); }
.cafe label > input, .cafe label > select, .cafe label > textarea { display: block; width: 100%; margin-top: 5px; min-height: 46px; padding: 10px 13px; border-radius: 13px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); font-size: 16px; font-weight: 400; color: var(--ink); outline: none; }
.cafe label > textarea { resize: vertical; min-height: 90px; }
.cafe label > input:focus, .cafe label > select:focus, .cafe label > textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(248, 194, 92, .15); }
.cafe select option { background: #22180F; }
.cafe fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cafe-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cafe-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.cafe-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.cafe-check input { flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); }
.cafe-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.cafe-pick label, .cafe-colors label { position: relative; cursor: pointer; }
.cafe-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cafe-pick span { display: inline-block; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .15s; }
.cafe-pick input:checked + span { background: rgba(248, 194, 92, .18); border-color: var(--gold); color: var(--gold); }
.cafe-pick input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.cafe-colors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cafe-colors label { cursor: pointer; }
.cafe-colors input { position: absolute; opacity: 0; pointer-events: none; }
.cafe-colors span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); transition: transform .15s, box-shadow .15s; }
.cafe-colors input:checked + span { transform: scale(1.12); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.cafe-colors input:focus-visible + span { outline: 2px solid #fff; outline-offset: 3px; }

/* Fenêtres */
.cafe-modal { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 4, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: cafe-fade .25s; overflow-y: auto; }
@keyframes cafe-fade { from { opacity: 0; } }
.cafe-modal-card { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 26px 22px 22px; border-radius: 26px; background: linear-gradient(180deg, #2A1D16 0%, #1A120E 100%); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: cafe-pop .3s var(--ease); touch-action: pan-y; overflow-x: hidden; overscroll-behavior: contain; }
.cafe-modal-card h2 { margin: 0; font: 700 23px/1.15 var(--display); text-align: center; }
.cafe-modal-cup { width: 58px; height: 58px; margin: 0 auto -4px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--grad-gold); box-shadow: 0 10px 26px rgba(248, 180, 80, .3); }
.cafe-modal-sub { margin: -6px 0 2px; text-align: center; color: var(--ink-2); font-size: 14px; }
.cafe-charte { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 13px; }
.cafe-charte ul { margin: 6px 0 10px; padding-left: 18px; color: var(--ink-2); }
.cafe-charte li { margin: 2px 0; }
.cafe-help ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cafe-help li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.cafe-help li > span { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(248, 194, 92, .12); font-size: 19px; }
.cafe-help li b { display: block; color: var(--ink); font-size: 14.5px; }

/* Joystick (écrans tactiles) */
.cafe-joy { position: absolute; z-index: 14; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .18); pointer-events: none; }
.cafe-joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(248, 194, 92, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }

/* Repère de destination */
.cafe-hide-s { display: inline; }

/* Tablette et mobile */
@media (max-width: 860px) {
  .cafe-card { left: 10px; right: 10px; width: auto; top: auto; bottom: calc(10px + var(--safe-b)); max-height: 72%; border-radius: 24px; z-index: 40; animation: cafe-up .3s var(--ease); }
  @keyframes cafe-up { from { transform: translateY(30px); opacity: 0; } }
  .cafe-drawer { width: 100%; border-left: 0; }
}
@media (max-width: 640px) {
  .cafe-hide-s, .cafe-brand-txt small { display: none; }
  .cafe-top { gap: 6px; left: 8px; right: 8px; }
  .cafe-chip { height: 40px; padding-right: 12px; }
  .cafe-btn { min-height: 40px; padding: 0 12px; }
  .cafe-top-actions .cafe-btn { width: 40px; padding: 0; }
  .cafe-online { padding: 0 11px; font-size: 12.5px; }
  .cafe-online [data-online-l] { display: none; }
  .cafe-guest { flex-wrap: wrap; top: calc(58px + var(--safe-t)); padding: 10px; gap: 8px 10px; }
  .cafe-guest div { flex-basis: calc(100% - 40px); }
  .cafe-guest .cafe-btn { flex: 1; }
  .cafe-notice { top: calc(58px + var(--safe-t)); }

  /* Chat en tiroir au bas de l'écran */
  .cafe-chat { left: 0; right: 0; bottom: 0; width: auto; height: auto; max-height: 62%; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); }
  .cafe-chat-bar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 50px; padding: 0 16px; border: 0; background: none; font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: left; }
  .cafe-chat-bar span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2); font-weight: 500; }
  .cafe-chat-chev { transition: transform .25s; color: var(--muted); }
  .cafe-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #FF4F79; color: #fff; font: 700 11px/20px var(--font); font-style: normal; text-align: center; }
  .cafe-chat .cafe-chat-body { display: none; height: 46vh; height: 46dvh; }
  .cafe-chat.is-open .cafe-chat-body { display: flex; }
  .cafe-chat.is-open .cafe-chat-chev { transform: rotate(180deg); }
  .cafe-chat.is-open .cafe-tabs { padding-top: 0; }
  .cafe-msg-flag { opacity: .6; }
  .cafe-action { left: 50%; bottom: calc(66px + var(--safe-b)); }
  .cafe.is-chat-open .cafe-action { bottom: calc(46dvh + 64px + var(--safe-b)); }
  .cafe-modal { padding: 0; place-items: end stretch; }
  .cafe-modal-card { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; padding-bottom: calc(22px + var(--safe-b)); animation: cafe-up .3s var(--ease); }
  .cafe-bubble { max-width: 170px; font-size: 12.5px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .cafe-chat { height: calc(100% - 70px); width: 330px; }
  .cafe-chat .cafe-chat-body { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Personnages du café (Léon, Nina) */
.cafe-tag.is-bot .cafe-tag-name { border-color: rgba(248, 194, 92, .35); background: rgba(40, 26, 14, .82); }
.cafe-msg.is-bot .cafe-msg-av { background: rgba(248, 194, 92, .16); font-size: 14px; }
.cafe-msg.is-bot .cafe-msg-text { color: var(--ink-2); font-style: italic; }
.cafe-tag.is-bot .cafe-bubble { max-width: 260px; -webkit-line-clamp: 8; background: #FFF4DC; }
/* Petits téléphones : six boutons dans la barre du haut, le logo seul suffit. */
@media (max-width: 400px) {
  .cafe-brand .cafe-brand-txt { display: none; }
  .cafe-brand { padding-right: 6px; }
  .cafe-top { gap: 5px; }
  .cafe-top-actions { gap: 5px; }
}
/* Qui parle : nom d'artiste ou de structure, tiré du compte Musifans */
.cafe-who { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.cafe-tag-name em { font-size: 11px; }
