/* DramaBoba — thème « Boba » (C3) : palette du logo. Tout passe par les variables ci-dessous. */
:root {
  --creme: #fbf7f2; --carte: #ffffff; --the: #e8c49a; --the-2: #efe0cc; --tapioca: #2b211c; --tapioca-2: #5c4a3d;
  --gris: #9a8f85; --gris-2: #cdbfb2; --trait: #eee3d3; --piste: #f3e9dc; --paille: #d96c8a; --paille-2: #b8506e; --rose-2: #f6dfe4;
  --vert: #3f6f57; --vert-2: #dcebe3; --ambre: #9a6410; --ambre-2: #fde9c9; --bl: #7a4b1f; --bl-2: #efe0cc;
  --sans: 'Nunito', -apple-system, system-ui, sans-serif;
  --r: 14px; --r-card: 22px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--creme); color: var(--tapioca); font: 600 15px/1.45 var(--sans); overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--paille); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- fond ---------- */
.blob { position: fixed; border-radius: 50%; z-index: -1; pointer-events: none; }
.blob.b1 { width: 260px; height: 260px; top: -110px; right: -80px; background: var(--rose-2); }
.blob.b2 { width: 220px; height: 220px; top: 40px; left: -120px; background: var(--the-2); }

/* ---------- structure ---------- */
#app { min-height: 100vh; padding-bottom: calc(100px + var(--safe-b)); }
.page { max-width: 640px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 20px 0; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font: 800 13px var(--sans); margin-bottom: 4px; }
.brand svg { width: 30px; height: 27px; }
.brand b { color: var(--paille); font-weight: 800; }
.h1 { font-size: 30px; line-height: 1; }
.count { font: 700 12px var(--sans); color: var(--gris); margin-top: 6px; }
.topbtns { display: flex; gap: 8px; }
.sqbtn { width: 44px; height: 44px; border-radius: 16px; background: var(--carte); border: 1.5px solid var(--trait); display: grid; place-items: center; color: var(--tapioca); position: relative; }
.sqbtn .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--paille); color: #fff; font: 800 11px/18px var(--sans); text-align: center; padding: 0 5px; }

.search { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 18px; background: var(--carte); border: 1.5px solid var(--trait); padding: 0 16px; color: var(--gris); }
.search input { flex: 1; border: 0; background: none; outline: 0; font-size: 16px; font-weight: 600; color: var(--tapioca); }
.search input::placeholder { color: var(--gris); }
.search button { width: 36px; height: 40px; display: grid; place-items: center; color: var(--gris); }
.search .clr { margin-right: -10px; border-radius: 12px; }
.search .clr svg { width: 18px; height: 18px; }
.search .clr:active { background: var(--piste); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 6px; margin: 0 -20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 38px; padding: 0 15px; border-radius: 999px; background: var(--carte); border: 1.5px solid var(--trait); font: 700 13px var(--sans); color: var(--tapioca-2); white-space: nowrap; }
.chip.on { background: var(--paille); border-color: var(--paille); color: #fff; }

/* ---------- liste fiches ---------- */
.list { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.card { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-card); background: var(--carte); border: 1.5px solid var(--trait); text-align: left; width: 100%; }
.poster { width: 72px; height: 100px; border-radius: 14px; flex-shrink: 0; background: var(--the-2); display: grid; place-items: center; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster.empty { background: linear-gradient(160deg, var(--the), #c8a170); }
.poster.empty span { font: 900 24px var(--sans); color: rgba(43,33,28,.5); }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.title { font: 800 17px/1.2 var(--sans); }
.title .fr { font-weight: 600; font-size: 13px; color: var(--gris); }
.meta { font: 600 13px var(--sans); color: var(--gris); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font: 700 11px var(--sans); padding: 4px 9px; border-radius: 999px; background: var(--rose-2); color: #a8455f; }
.tag.bl { background: var(--bl-2); color: var(--bl); }
.tag.ok { background: var(--vert-2); color: var(--vert); }
.tag.warn { background: var(--ambre-2); color: var(--ambre); }
.tag.dark { background: var(--tapioca); color: #fff; }
.sub { display: flex; align-items: center; gap: 8px; font: 600 13px var(--sans); color: var(--gris); margin-top: 1px; }
.pearls { display: inline-flex; gap: 2px; }
.bar { height: 6px; border-radius: 3px; background: var(--piste); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 6px; border-radius: 3px; background: var(--paille); }
.heart { width: 44px; height: 44px; margin: -10px -12px -10px 0; display: grid; place-items: center; color: var(--gris-2); }
.heart.on { color: var(--paille); }
.empty-state { padding: 60px 0; text-align: center; color: var(--gris); font: 700 16px var(--sans); }

/* ---------- liste compacte ---------- */
.list.compact { gap: 0; }
.row-c { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--trait); width: 100%; text-align: left; }
.row-c .poster { width: 34px; height: 48px; border-radius: 7px; }
.row-c .poster.empty span { font-size: 14px; }
.row-c .t { font: 800 14px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-c .t .fr { font-weight: 600; color: var(--gris); }
.row-c .m { font: 600 11.5px var(--sans); color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-c .mid { flex: 1; min-width: 0; }
.row-c .right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.row-c .etat { font: 700 10.5px var(--sans); color: var(--gris); }
.row-c .etat.vu { color: var(--vert); } .row-c .etat.en_cours, .row-c .etat.a_venir { color: var(--ambre); } .row-c .etat.abandonne { color: var(--paille-2); }
.row-c .heart { width: 32px; height: 32px; margin: 0; }

/* ---------- bouton + ---------- */
.fab { position: fixed; right: 22px; bottom: calc(100px + var(--safe-b)); width: 60px; height: 60px; border-radius: 22px; background: var(--paille); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(217,108,138,.4); z-index: 5; }

/* ---------- nav ---------- */
.nav { position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--safe-b)); height: 68px; border-radius: 24px; background: var(--carte); border: 1.5px solid var(--trait); box-shadow: 0 8px 24px rgba(58,49,43,.08); display: flex; justify-content: space-around; align-items: center; padding: 0 8px; z-index: 5; max-width: 608px; margin: 0 auto; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; height: 56px; justify-content: center; font: 700 11px var(--sans); color: var(--gris); }
.nav button.on { color: var(--paille); font-weight: 800; }

/* ---------- feuilles ---------- */
.overlay { position: fixed; inset: 0; background: rgba(43,33,28,.35); z-index: 20; animation: fade .18s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 94vh; overflow-y: auto; background: var(--creme); border-radius: 26px 26px 0 0; z-index: 21; padding: 10px 20px calc(24px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(43,33,28,.18); animation: up .22s ease-out; max-width: 640px; margin: 0 auto; }
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(12px + var(--safe-t)); }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--gris-2); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 24px; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; color: var(--tapioca); background: var(--carte); border: 1.5px solid var(--trait); }

.detail-hero { display: flex; gap: 16px; margin-bottom: 14px; }
.detail-hero .poster { width: 100px; height: 140px; border-radius: 18px; }
.detail-title { font: 800 24px/1.15 var(--sans); }
.detail-orig { font: 600 14px var(--sans); color: var(--gris); }
.section { margin-top: 18px; padding: 14px; background: var(--carte); border: 1.5px solid var(--trait); border-radius: var(--r-card); }
.section h3 { font: 800 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--gris); margin-bottom: 10px; }
.synopsis { font-size: 15px; font-weight: 600; color: var(--tapioca-2); }
.plats { display: flex; gap: 8px; flex-wrap: wrap; }
.plat { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 999px; background: var(--the-2); font: 700 13px var(--sans); color: var(--bl); text-decoration: none; }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--piste); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { height: 40px; border-radius: 11px; font: 700 13px var(--sans); color: var(--tapioca-2); }
.seg button.on { background: var(--tapioca); color: #fff; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.row label { font: 700 14px var(--sans); color: var(--tapioca-2); }
.bigpearls { display: flex; gap: 4px; }
.bigpearls button { width: 40px; height: 44px; display: grid; place-items: center; color: var(--gris-2); }
.bigpearls button.on { color: var(--tapioca); }
.stepper { display: inline-flex; align-items: center; background: var(--piste); border-radius: 999px; }
.stepper button { width: 44px; height: 40px; font-size: 20px; font-weight: 800; color: var(--tapioca); }
.stepper span { min-width: 64px; text-align: center; font: 800 14px var(--sans); }
.prio { display: flex; gap: 6px; }
.prio button { height: 34px; padding: 0 10px; white-space: nowrap; font-size: 12px !important; background: var(--piste); border-radius: 999px; font: 700 13px var(--sans); color: var(--tapioca-2); }
.prio button.on { background: var(--paille); color: #fff; }
textarea.comment { width: 100%; min-height: 72px; border: 1.5px solid var(--trait); border-radius: var(--r); padding: 10px 12px; background: var(--creme); resize: vertical; font-weight: 600; }
.others { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--tapioca-2); }
.others .pearls { vertical-align: middle; }

/* ---------- formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font: 800 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.field input, .field select, .field textarea { height: 46px; border: 1.5px solid var(--trait); border-radius: var(--r); padding: 0 12px; background: var(--carte); outline: 0; font-size: 16px; font-weight: 600; }
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--paille); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pillset { display: flex; gap: 6px; flex-wrap: wrap; }
.pillset button { height: 36px; padding: 0 12px; border: 1.5px solid var(--trait); border-radius: 999px; font: 700 13px var(--sans); color: var(--tapioca-2); background: var(--carte); }
.pillset button.on { background: var(--tapioca); border-color: var(--tapioca); color: #fff; }
.btn { height: 50px; padding: 0 22px; border-radius: 999px; background: var(--tapioca); color: #fff; font: 800 15px var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn.pink { background: var(--paille); }
.btn.ghost { background: transparent; color: var(--tapioca); border: 1.5px solid var(--tapioca); }
.btn:disabled { opacity: .5; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tmdb-results { display: flex; flex-direction: column; border: 1.5px solid var(--trait); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.tmdb-results button { display: flex; gap: 12px; align-items: center; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--trait); background: var(--carte); }
.tmdb-results button:last-child { border-bottom: 0; }
.tmdb-results img, .tmdb-results .ph { width: 40px; height: 58px; border-radius: 6px; object-fit: cover; background: var(--the-2); flex-shrink: 0; }
.tmdb-results .t { font: 800 15px var(--sans); }
.tmdb-results .m { font-size: 12px; color: var(--gris); }
.hint { font-size: 13px; color: var(--gris); font-weight: 600; }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; text-align: center; }
.login .mark { width: 160px; }
.profiles { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.profile { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; font-weight: 700; }
.avatar { width: 68px; height: 68px; border-radius: 24px; display: grid; place-items: center; font: 900 26px var(--sans); color: #fff; border: 3px solid transparent; }
.profile.on .avatar { border-color: var(--tapioca); }
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input { width: 52px; height: 60px; text-align: center; font: 800 26px var(--sans); border: 1.5px solid var(--trait); border-radius: var(--r); background: var(--carte); outline: 0; }
.pin input:focus { border-color: var(--paille); }
.err { color: var(--paille-2); font-size: 14px; min-height: 20px; font-weight: 700; }

/* ---------- profil ---------- */
.stat { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--trait); font-weight: 700; }
.stat b { font: 900 22px var(--sans); }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: var(--tapioca); color: #fff; padding: 10px 16px; border-radius: 999px; font: 700 14px var(--sans); z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.loading { padding: 40px; text-align: center; color: var(--gris); font: 700 15px var(--sans); }
@media (min-width: 700px) { .sheet { left: calc(50% - 320px); right: auto; width: 640px; } .sheet.full { border-radius: 0; } .fab { right: calc(50% - 300px); } }

/* séparateur « Mes choix » dans la feuille de filtres */
.sheet .sep { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; padding-top: 14px; border-top: 1px dashed var(--gris-2); }
.sheet .sep span { font-weight: 800; font-size: 15px; color: var(--paille); }
.sheet .sep small { color: var(--gris); font-weight: 600; }

/* ---------- v2 : puces-menus ---------- */
.chip.menu { display: inline-flex; align-items: center; gap: 6px; padding-right: 11px; }
.chip.menu i { font-style: normal; font-size: 11px; opacity: .7; }
.chip.clear { background: var(--tapioca); border-color: var(--tapioca); color: #fff; }
.choices { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.choices button { display: flex; justify-content: space-between; align-items: center; height: 50px; padding: 0 16px; border-radius: var(--r); background: var(--carte); border: 1.5px solid var(--trait); font: 700 15px var(--sans); text-align: left; }
.choices button.on { border-color: var(--paille); background: var(--rose-2); color: var(--paille-2); }
.choices button b { color: var(--paille); }

/* ---------- v2 : plateformes sur les cartes ---------- */
.plats-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pm { font: 800 10px/1 var(--sans); padding: 4px 7px; border-radius: 6px; background: var(--piste); color: var(--tapioca-2); letter-spacing: .01em; }
.pm.p-netflix { background: #2b211c; color: #fff; }
.pm.p-viki { background: #1a8ed8; color: #fff; }
.pm.p-primevideo { background: #00a8e1; color: #fff; }
.pm.p-disney { background: #113ccf; color: #fff; }
.pm.p-iqiyi { background: #00cc36; color: #fff; }
.pm.p-wetv { background: #ff6a00; color: #fff; }
.pm.p-youtube { background: #e62117; color: #fff; }
.pm.p-crunchyroll { background: #f47521; color: #fff; }
.pm.p-appletv { background: #111; color: #fff; }
.pm.p-kocowa { background: #7b4bcf; color: #fff; }
.pm.p-dailymotion { background: #0066dc; color: #fff; }
.pm.p-kisskh { background: #d96c8a; color: #fff; }
.pm.more { background: transparent; color: var(--gris); }
.row-c .plats-mini { margin-top: 3px; gap: 3px; }
.row-c .pm { font-size: 9px; padding: 3px 5px; }

/* ---------- v2 : nav 5 onglets + pastille ---------- */
.nav button { width: 62px; position: relative; }
.nav .nbadge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--paille); color: #fff; font: 800 10px/18px var(--sans); text-align: center; font-style: normal; }

/* ---------- v2 : formulaire ---------- */
.tmdb-results button.have { opacity: .75; background: var(--piste); }
.have-tag { font: 700 11px var(--sans); color: var(--paille-2); margin-top: 3px; }
.form-err { background: var(--rose-2); color: var(--paille-2); border-radius: var(--r); padding: 10px 12px; font-weight: 700; margin: 4px 0 10px; }

/* ---------- v2 : actus ---------- */
h3.sec { font: 800 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--gris); margin: 22px 0 10px; }
.nv-list { display: flex; flex-direction: column; gap: 10px; }
.nv { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--r-card); background: var(--carte); border: 1.5px solid var(--trait); position: relative; }
.nv .poster { width: 58px; height: 82px; border-radius: 10px; }
.nv-body { flex: 1; min-width: 0; padding-right: 44px; }
.nv-body .t { font: 800 15px/1.2 var(--sans); }
.nv-body .m { font: 600 12px var(--sans); color: var(--gris); margin: 3px 0 5px; }
.nv-body .s { font: 600 12.5px/1.4 var(--sans); color: var(--tapioca-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.mini-add { position: absolute; right: 10px; top: 10px; width: 38px; height: 38px; border-radius: 12px; background: var(--paille); color: #fff; display: grid; place-items: center; }
.mini-add:disabled { opacity: .4; }
.act-list { display: flex; flex-direction: column; }
.act { padding: 10px 0; border-bottom: 1px solid var(--trait); font: 600 14px var(--sans); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.act .ttl { font-weight: 800; color: var(--paille-2); cursor: pointer; }
.act .del { font-weight: 800; color: var(--gris); text-decoration: line-through; }
.act small { color: var(--gris); margin-left: auto; font-weight: 600; }

/* ---------- v2 : feuille de filtres plus douce ---------- */
.sheet .field select { appearance: none; -webkit-appearance: none; background: var(--carte) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d96c8a' stroke-width='2.5' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center; padding-right: 34px; border-radius: 14px; }
.sheet .field label { color: var(--paille-2); }
