/* =========================================================================
   POKI — PWA · style « Pokiche » (écran de poche nuit + accents chauds)
   ========================================================================= */
:root {
  --night: #15192b; --night-2: #0d101d; --panel: #1d2237; --panel-2: #262c46; --line: rgba(255,255,255,.08);
  --text: #f1f5f9; --text-2: #a8b1c7; --text-3: #6b7490;
  --cream: #fbf4e9; --coral: #ff7a59; --coral-d: #e85c3b; --mint: #34d399; --sun: #facc15; --rose: #ec4899; --sky: #38bdf8; --lilac: #a78bfa;
  --accent: #ff7a59; --accent-glow: rgba(255,122,89,.38);
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px; --pill: 999px;
  --ease: cubic-bezier(.22,1,.36,1);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 70% at 50% 0%, #232a4a 0%, var(--night) 45%, var(--night-2) 100%) fixed;
  color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
button, input, label { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }

.app { position: relative; height: 100dvh; max-width: 480px; margin: 0 auto; overflow: hidden; }
@media (min-width: 600px) {
  body { display: grid; place-items: center; }
  .app { height: min(920px, 96dvh); width: 430px; border-radius: 44px; box-shadow: 0 0 0 10px #262b49, 0 40px 90px rgba(0,0,0,.55); background: var(--night); }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 18px calc(var(--safe-b) + 14px); animation: screen-in .45s var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; padding: 15px 22px; border-radius: var(--pill); transition: transform .15s var(--ease), background .2s; }
.btn:active { transform: scale(.96); }
.btn-block { width: 100%; }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 10px 26px rgba(255,122,89,.35); }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); }
.btn-small { padding: 9px 14px; font-size: .85rem; background: rgba(255,255,255,.1); }
.btn-danger { background: #f43f5e; color: #fff; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.07); font-size: 1.2rem; font-weight: 800; }

/* ---------- Accueil ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; letter-spacing: -.04em; }
.logo-dot { width: 32px; height: 32px; border-radius: 12px 12px 12px 4px; background: #fff; display: grid; place-items: center; }
.logo-dot i { width: 11px; height: 11px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 10px var(--accent-glow); }
.welcome-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.welcome-ring { position: relative; width: 250px; height: 250px; }
.welcome-ring img { position: absolute; width: 96px; height: 96px; transition: transform .6s var(--ease); animation: float 4s ease-in-out infinite; }
.welcome-ring img:nth-child(1) { left: 77px; top: 70px; width: 110px; height: 110px; z-index: 2; }
.welcome-ring img:nth-child(2) { left: 0; top: 10px; animation-delay: -1s; }
.welcome-ring img:nth-child(3) { right: 0; top: 10px; animation-delay: -2s; }
.welcome-ring img:nth-child(4) { left: 14px; bottom: 0; animation-delay: -3s; }
.welcome-ring img:nth-child(5) { right: 14px; bottom: 0; animation-delay: -1.5s; }
@keyframes float { 50% { transform: translateY(-8px); } }
.welcome-hero h1 { font-size: 2rem; line-height: 1.05; letter-spacing: -.04em; }
.welcome-hero h1 em { font-style: normal; color: var(--coral); }
.welcome-hero p { color: var(--text-2); max-width: 32ch; }
.welcome-actions { display: grid; gap: 10px; }

/* ---------- Création ---------- */
.create-head { display: flex; align-items: center; gap: 12px; }
.steps { flex: 1; display: flex; gap: 6px; }
.steps i { flex: 1; height: 6px; border-radius: 9px; background: rgba(255,255,255,.1); transition: background .3s; }
.steps i.on { background: var(--coral); }
.create-count { font-size: .8rem; color: var(--text-3); font-weight: 700; }
.create-preview { display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; }
.preview-avatar { width: 150px; height: 150px; }
.preview-avatar svg, .preview-avatar img { width: 100%; height: 100%; }
.preview-name { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.preview-sub { color: var(--text-2); font-size: .82rem; }
.create-body { flex: 1; overflow-y: auto; padding: 10px 2px 10px; -webkit-overflow-scrolling: touch; }
.create-body h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.create-body h3 { font-size: .92rem; margin: 18px 0 10px; color: var(--text-2); }
.hint { color: var(--text-3); font-size: .84rem; margin: 4px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-label { flex-basis: 100%; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.chip { background: rgba(255,255,255,.07); padding: 9px 13px; border-radius: var(--pill); font-weight: 700; font-size: .88rem; color: var(--text-2); transition: background .2s, color .2s; }
.chip.on { background: #fff; color: var(--night); }
.chip.trait.on { background: var(--coral); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.field input[type=text] { user-select: text; -webkit-user-select: text; background: rgba(255,255,255,.07); border: 2px solid transparent; border-radius: var(--r-md); padding: 12px 14px; font-weight: 800; font-size: 1.05rem; color: var(--text); outline: none; }
.field input[type=text]:focus { border-color: var(--coral); }
.color { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.07); border-radius: var(--r-md); padding: 6px 10px; }
.color input { width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; padding: 0; cursor: pointer; }
.color input::-webkit-color-swatch-wrapper { padding: 0; }
.color input::-webkit-color-swatch { border: 0; border-radius: 9px; }
.color code { font-size: .78rem; color: var(--text-3); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: .86rem; font-weight: 700; color: var(--text-2); }
.check input { accent-color: var(--coral); width: 18px; height: 18px; }
.create-foot { padding-top: 10px; }

/* ---------- Éclosion ---------- */
.screen-hatch { align-items: center; justify-content: center; gap: 26px; text-align: center; }
.hatch-text h2 { font-size: 1.7rem; letter-spacing: -.03em; }
.hatch-text p { color: var(--text-2); margin-top: 6px; }
.egg-btn { width: 200px; height: 240px; animation: egg-idle 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.egg-btn svg { width: 100%; height: 100%; overflow: visible; }
.egg-btn.tap { animation: egg-tap .35s var(--ease); }
.egg-btn.hatching { animation: egg-shake .12s linear infinite; }
@keyframes egg-idle { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes egg-tap { 30% { transform: scale(1.08, .92) rotate(-6deg); } 70% { transform: scale(.96, 1.05) rotate(5deg); } }
@keyframes egg-shake { 0% { transform: translateX(-4px) rotate(-4deg); } 50% { transform: translateX(4px) rotate(4deg); } 100% { transform: translateX(-4px) rotate(-4deg); } }
.hatch-progress { width: 180px; height: 8px; border-radius: 9px; background: rgba(255,255,255,.1); overflow: hidden; }
.hatch-progress i { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 9px; transition: width .3s var(--ease); }
.hatch-flash { position: absolute; inset: 0; background: #fff; animation: flash .9s ease-out forwards; pointer-events: none; z-index: 30; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Jeu principal ---------- */
.screen-main { padding: calc(var(--safe-t) + 10px) 14px 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 10px; }
.who-name { font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.1; }
.who-meta { display: flex; gap: 8px; align-items: center; font-size: .76rem; color: var(--text-2); font-weight: 700; margin-top: 3px; }
.stage-badge { background: var(--accent); color: var(--night); padding: 2px 9px; border-radius: var(--pill); font-weight: 800; transition: background .4s; }
.place { display: flex; background: rgba(255,255,255,.07); border-radius: var(--pill); padding: 3px; }
.place button { width: 42px; height: 34px; border-radius: var(--pill); font-size: 1.05rem; opacity: .5; transition: background .2s, opacity .2s; }
.place button.on { background: #fff; opacity: 1; }
.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; padding-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.view-poki { overflow: hidden; }

.stage { position: relative; flex: 1; min-height: 210px; border-radius: var(--r-xl); overflow: hidden; background: var(--panel); transition: background .8s; }
.stage.pocket { background: radial-gradient(110% 80% at 50% 15%, rgba(56,189,248,.16), transparent 60%), linear-gradient(180deg, #1f2742, #141a2e); }
.stage.home { background: radial-gradient(110% 80% at 50% 15%, rgba(245,158,11,.22), transparent 60%), linear-gradient(180deg, #3a2414, #1c1009); }
.stage.night { background: radial-gradient(110% 80% at 50% 10%, rgba(167,139,250,.18), transparent 60%), linear-gradient(180deg, #1a1535, #0b0a1a); }
.stage::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 10%; height: 18px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(6px); }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky .star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .7; animation: twinkle 3s ease-in-out infinite; }
.sky .moon { position: absolute; top: 16px; right: 22px; width: 30px; height: 30px; border-radius: 50%; box-shadow: -8px 4px 0 0 #fde68a; transform: rotate(-20deg); }
.sky .sun { position: absolute; top: 14px; right: 20px; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, #fde68a, #f59e0b); box-shadow: 0 0 24px rgba(253,230,138,.6); }
.sky .window { position: absolute; top: 16px; left: 18px; width: 54px; height: 44px; border-radius: 10px; border: 3px solid rgba(255,255,255,.14); background: linear-gradient(180deg, rgba(125,211,252,.25), rgba(125,211,252,.05)); }
@keyframes twinkle { 50% { opacity: .2; } }
.avatar-wrap { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; transition: transform .8s var(--ease); }
.avatar-wrap::before { content: ""; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 70%); filter: blur(24px); transition: background .5s; }
#avatar-mount { position: relative; width: min(78vw, 300px, 40dvh); aspect-ratio: 1; }
#pet-svg { width: 100%; height: 100%; cursor: pointer; outline: none; }
.status-icons { position: absolute; top: 12px; left: 14px; z-index: 4; display: flex; gap: 6px; }
.status-icons span { background: rgba(0,0,0,.35); backdrop-filter: blur(6px); padding: 4px 9px; border-radius: var(--pill); font-size: .78rem; font-weight: 800; animation: pop .4s var(--ease); }
.poops { position: absolute; left: 0; right: 0; bottom: 6%; z-index: 3; display: flex; justify-content: space-between; padding: 0 8%; pointer-events: none; }
.poop { width: 38px; height: 38px; animation: poop-in .5s var(--ease); }
.poop:nth-child(2) { order: 3; } .poop:nth-child(3) { margin-right: auto; margin-left: 8px; } .poop:nth-child(4) { margin-left: auto; margin-right: 8px; }
.poop .stink { animation: stink 2s ease-in-out infinite; }
@keyframes poop-in { from { transform: scale(0) translateY(10px); } }
@keyframes stink { 0%,100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-4px); opacity: .2; } }
.night-veil { position: absolute; inset: 0; z-index: 5; background: rgba(4,5,14,.72); opacity: 0; pointer-events: none; transition: opacity .8s; }
.night-veil.on { opacity: 1; }
.fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.fx span { position: absolute; font-size: 1.6rem; animation: fx-up 1.2s var(--ease) forwards; }
.fx .bubble-fx { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.12); animation: fx-up 1.4s ease-out forwards; }
@keyframes fx-up { from { opacity: 1; transform: translateY(0) scale(.6); } to { opacity: 0; transform: translateY(-90px) scale(1.2); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.bubble { position: relative; align-self: center; max-width: 94%; margin-top: -2px; background: #fff; color: var(--night); font-weight: 700; font-size: .9rem; padding: 9px 15px; border-radius: 18px; text-align: center; min-height: 38px; transition: transform .2s var(--ease); }
.bubble::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; background: #fff; border-radius: 3px; transform: translateX(-50%) rotate(45deg); }
.bubble.pop { transform: scale(1.05); }

.needs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.need { background: rgba(255,255,255,.05); border-radius: 14px; padding: 7px 4px 8px; text-align: center; }
.need-ico { font-size: 1.05rem; line-height: 1; }
.need.low .need-ico { animation: wobble .6s ease-in-out infinite; }
@keyframes wobble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.pips { display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
.pips i { width: 8px; height: 8px; border-radius: 3px; background: rgba(255,255,255,.1); transition: background .4s; }
.need-lbl { font-size: .62rem; color: var(--text-3); font-weight: 700; margin-top: 4px; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 4px; }
.act { display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.07); border-radius: 18px; padding: 12px 6px; font-weight: 800; font-size: .86rem; color: var(--text); transition: transform .15s var(--ease), background .2s, opacity .2s; }
.act span { font-size: 1.25rem; line-height: 1; }
.act b { font-weight: 800; }
.act:active { transform: scale(.93); }
.act.alert { background: rgba(255,122,89,.22); box-shadow: inset 0 0 0 2px rgba(255,122,89,.6); }
.act.dim { opacity: .45; }

.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 -14px; padding: 8px 14px calc(var(--safe-b) + 8px); border-top: 1px solid var(--line); background: rgba(13,16,29,.85); backdrop-filter: blur(14px); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 800; color: var(--text-3); padding: 4px; }
.tabbar button span { font-size: 1.2rem; filter: grayscale(1); opacity: .6; }
.tabbar button.on { color: var(--text); }
.tabbar button.on span { filter: none; opacity: 1; }

/* ---------- Carnet ---------- */
.idcard { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: var(--r-xl); padding: 16px; }
.idcard img { width: 110px; height: 110px; flex-shrink: 0; }
.idcard-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; }
.idcard-sub { color: var(--text-2); font-size: .82rem; margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: var(--pill); }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: rgba(255,255,255,.05); border-radius: 16px; padding: 11px 13px; font-size: .74rem; color: var(--text-2); font-weight: 700; }
.stat b { display: block; color: var(--text); font-size: 1rem; margin-top: 2px; }
.sec-title { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 10px 4px 0; }
.journal { list-style: none; display: grid; gap: 6px; }
.journal li { display: flex; gap: 10px; background: rgba(255,255,255,.04); border-radius: 14px; padding: 9px 12px; font-size: .84rem; }
.journal time { color: var(--text-3); font-size: .74rem; font-weight: 700; white-space: nowrap; padding-top: 1px; }

/* ---------- Réglages ---------- */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: rgba(255,255,255,.05); border-radius: 16px; padding: 13px 14px; cursor: pointer; }
.setting b { display: block; font-size: .92rem; }
.setting small { display: block; color: var(--text-3); font-size: .78rem; margin-top: 2px; }
.setting.danger { background: rgba(244,63,94,.08); }
.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 48px; height: 28px; border-radius: var(--pill); background: rgba(255,255,255,.15); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(20px); }
.version { text-align: center; color: var(--text-3); font-size: .74rem; margin-top: 8px; }

/* ---------- Feuilles & mini-jeu ---------- */
.sheet-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(4,6,14,.6); backdrop-filter: blur(4px); display: flex; align-items: flex-end; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; background: var(--panel); border-radius: 28px 28px 0 0; padding: 22px 18px calc(var(--safe-b) + 18px); display: grid; gap: 10px; animation: sheet-up .35s var(--ease); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet h3 { font-size: 1.1rem; }
.sheet p { color: var(--text-2); font-size: .9rem; }
.sheet-opt { display: flex; align-items: center; gap: 14px; text-align: left; background: rgba(255,255,255,.06); border-radius: 18px; padding: 14px; }
.sheet-opt span { font-size: 1.9rem; }
.sheet-opt small { display: block; color: var(--text-3); font-size: .8rem; }

.game { position: absolute; inset: 0; z-index: 45; background: linear-gradient(180deg, #1f2742, #0d101d); display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-t) + 20px) 18px calc(var(--safe-b) + 20px); gap: 12px; animation: screen-in .35s var(--ease); }
.game-head { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.game-title { font-weight: 800; font-size: 1.2rem; }
.game-score { font-size: .8rem; font-weight: 800; color: var(--text-2); background: rgba(255,255,255,.07); padding: 5px 11px; border-radius: var(--pill); }
.game-poki { width: 150px; height: 150px; }
.game-poki img { width: 100%; height: 100%; }
.game-msg { font-weight: 700; color: var(--text-2); min-height: 1.5em; text-align: center; }
.bowls { position: relative; width: 100%; max-width: 360px; height: 160px; margin-top: auto; margin-bottom: auto; }
.bowl { position: absolute; bottom: 10px; width: 30%; height: 120px; transition: left .32s var(--ease); }
.bowl svg { width: 100%; height: 100%; overflow: visible; }
.bowl .lid { transition: transform .35s var(--ease); transform-origin: 50% 100%; }
.bowl.open .lid { transform: translateY(-46px) rotate(-8deg); }
.bowl .treat { opacity: 0; transition: opacity .2s; }
.bowl.open .treat { opacity: 1; }
.bowl:disabled { cursor: default; }

/* ---------- Toast ---------- */
.toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -20px); z-index: 60; background: #fff; color: var(--night); font-weight: 800; font-size: .88rem; padding: 11px 16px; border-radius: var(--pill); opacity: 0; pointer-events: none; transition: all .3s var(--ease); box-shadow: 0 12px 30px rgba(0,0,0,.35); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.action { pointer-events: auto; cursor: pointer; }

@media (max-height: 700px) {
  .act { padding: 9px 4px; font-size: .8rem; }
  .need { padding: 5px 2px 6px; }
  .bubble { font-size: .84rem; padding: 7px 12px; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Sauvegarde en ligne ---------- */
.link-btn { text-align: center; font-size: .84rem; font-weight: 700; color: var(--text-3); text-decoration: underline; padding: 6px; cursor: pointer; }
.btn:disabled { opacity: .45; }

/* ---------- Compte ---------- */
.sheet { max-height: 94dvh; overflow-y: auto; }
.text-input { width: 100%; user-select: text; -webkit-user-select: text; background: rgba(255,255,255,.07); border: 2px solid transparent; border-radius: var(--r-md); padding: 14px; color: var(--text); outline: none; font-weight: 700; font-size: 1rem; }
.text-input:focus { border-color: var(--coral); }
.text-input::placeholder { color: var(--text-3); font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap .text-input { padding-right: 90px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: .76rem; font-weight: 800; color: var(--text-2); background: rgba(255,255,255,.08); padding: 7px 10px; border-radius: 999px; }
.check.small { align-items: flex-start; font-size: .78rem; font-weight: 600; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.check.small input { flex-shrink: 0; margin-top: 1px; }
.form-err { color: #fda4af; font-weight: 700; font-size: .86rem; }
.form-ok { color: #a7f3d0; font-weight: 700; font-size: .86rem; }
.form-warn { color: #fef08a; background: rgba(250,204,21,.1); border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: .84rem; }
.sheet-avatar { display: grid; place-items: center; margin: -4px 0 -2px; }
.sheet-avatar img { width: clamp(72px, 13dvh, 104px); height: clamp(72px, 13dvh, 104px); animation: float 4s ease-in-out infinite; }
.sheet-avatar.sad img { animation: wobble 1.2s ease-in-out infinite; }
#sheet-signup h3, #sheet-flee h3 { text-align: center; font-size: 1.3rem; }
#signup-text, #flee-text { text-align: center; }
.welcome-actions .link-btn { background: none; }

/* =========================================================================
   MISE EN PAGE ADAPTATIVE — tout tient dans l'écran, sans défilement vertical
   (les tailles suivent la hauteur disponible grâce à dvh / clamp)
   ========================================================================= */
.sheet-row { display: flex; justify-content: space-between; gap: 10px; }
.danger-text { color: #fda4af; }
.ellipsis { min-width: 0; }
.ellipsis b, .ellipsis small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-state { font-size: .8rem; cursor: help; }

/* Accueil */
.welcome-ring { width: clamp(170px, 34dvh, 250px); height: clamp(170px, 34dvh, 250px); }
.welcome-ring img { width: 38%; height: 38%; }
.welcome-ring img:nth-child(1) { left: 31%; top: 28%; width: 44%; height: 44%; }
.welcome-hero { gap: clamp(8px, 1.6dvh, 14px); min-height: 0; }
.welcome-hero h1 { font-size: clamp(1.5rem, 4.2dvh, 2rem); }

/* Création */
.preview-avatar { width: clamp(76px, 15dvh, 150px); height: clamp(76px, 15dvh, 150px); }
.create-preview { padding: clamp(2px, 1dvh, 8px) 0 0; }
.create-body { padding-top: clamp(4px, 1dvh, 10px); }
.create-body h3 { margin: clamp(8px, 1.8dvh, 18px) 0 8px; }

/* Éclosion */
.egg-btn { width: clamp(140px, 26dvh, 200px); height: clamp(168px, 31dvh, 240px); }

/* Jeu : la scène prend la place restante */
.stage { min-height: 120px; }
#avatar-mount { width: min(78vw, 300px, 36dvh); }
.view { padding-bottom: 8px; gap: clamp(6px, 1.2dvh, 10px); }

/* Carnet : fiche, chiffres sur 3 colonnes, journal qui remplit le reste */
.view-book { overflow: hidden; }
.idcard { padding: clamp(10px, 1.6dvh, 16px); flex-shrink: 0; }
.idcard img { width: clamp(70px, 12dvh, 110px); height: clamp(70px, 12dvh, 110px); }
.idcard-name { font-size: clamp(1.15rem, 3dvh, 1.5rem); }
.statgrid { grid-template-columns: repeat(3, 1fr); gap: 6px; flex-shrink: 0; }
.stat { padding: clamp(6px, 1dvh, 10px) 10px; font-size: .68rem; border-radius: 12px; }
.stat b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-book .sec-title { margin-top: 2px; flex-shrink: 0; }
.journal { flex: 1; min-height: 0; overflow: hidden; align-content: start; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.journal li { padding: 7px 11px; font-size: .8rem; }

/* Réglages : lignes compactes */
.view-settings { gap: 6px; }
.setting { padding: clamp(8px, 1.3dvh, 13px) 14px; border-radius: 14px; }
.setting b { font-size: .9rem; }
.setting small { font-size: .74rem; }
.view-settings .sec-title { margin-top: 4px; }

/* Mini-jeu */
.game { gap: clamp(6px, 1.4dvh, 12px); }
.game-poki { width: clamp(96px, 18dvh, 150px); height: clamp(96px, 18dvh, 150px); }
.bowls { height: clamp(120px, 22dvh, 160px); }
.bowl { height: 75%; }

/* Petits écrans (iPhone SE, petits Android) */
@media (max-height: 700px) {
  .topbar { padding-bottom: 6px; }
  .who-name { font-size: 1.15rem; }
  .needs .need-lbl { display: none; }
  .pips { margin-top: 4px; }
  .act { padding: 8px 4px; font-size: .78rem; gap: 6px; }
  .act span { font-size: 1.1rem; }
  .tabbar { padding-top: 5px; }
  .tabbar button span { font-size: 1.05rem; }
  .sheet { padding: 16px 16px calc(var(--safe-b) + 14px); gap: 8px; }
  .text-input { padding: 11px 12px; }
  .view-settings .setting small:not(#account-sub) { display: none; }
  .welcome-hero p { font-size: .86rem; }
  /* Création : aperçu en ligne, puces compactes */
  .create-preview { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 12px; justify-content: center; align-items: center; }
  .preview-avatar { grid-row: 1 / 3; width: 70px; height: 70px; }
  .preview-name { align-self: end; }
  .preview-sub { align-self: start; }
  .create-body h2 { font-size: 1.1rem; }
  .hint { margin: 2px 0 8px; }
  .chip { padding: 7px 11px; font-size: .82rem; }
  .chips { gap: 6px; }
  .grid2 { gap: 8px; }
  .color { padding: 4px 8px; }
  .color input { width: 30px; height: 30px; }
  .check { margin-top: 8px; }
}
@media (max-height: 600px) {
  .sheet-avatar { display: none; }
  .view-settings { gap: 4px; }
  .setting { padding: 6px 12px; }
  .view-settings .sec-title { margin-top: 0; font-size: .66rem; }
  .version { display: none; }
  .welcome-hero p { display: none; }
}

/* ---------- Écran de secours (boot-guard.js) ---------- */
.screen-error { justify-content: center; align-items: center; text-align: center; }
.error-box { display: grid; gap: 14px; max-width: 320px; }
.error-ico { font-size: 3rem; }
.error-box h2 { font-size: 1.4rem; letter-spacing: -.02em; }
.error-box p { color: var(--text-2); font-size: .92rem; }

/* ---------- v1.5 : actions endormies, journal, liens légaux ---------- */
.act:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.act:disabled.alert { box-shadow: none; background: rgba(255,255,255,.07); }
.view-book .journal { flex: none; -webkit-mask-image: none; mask-image: none; }
.journal-more { flex-shrink: 0; padding: 11px; font-size: .86rem; }
.journal-full { max-height: 62dvh; overflow-y: auto; -webkit-mask-image: none; mask-image: none; }
.setting-link { text-decoration: none; color: inherit; }
.setting-link span { font-size: 1.4rem; color: var(--text-3); }
.legal-link { text-align: center; font-size: .74rem; color: var(--text-3); text-decoration: none; padding: 4px; }
.check.small a { color: var(--text-2); }
@media (max-height: 600px) {
  .view-book .sec-title { display: none; }
  .journal-more { padding: 8px; }
  .journal li { padding: 6px 10px; }
}

/* =========================================================================
   v1.5.1 — L'appli occupe exactement l'écran visible, sans défilement de page.
   (Sur iPhone, height:100% = hauteur SANS les barres du navigateur, ce qui
   créait un petit défilement inutile.) La barre d'onglets reste toujours visible.
   ========================================================================= */
html, body { height: 100%; overflow: hidden; }
.app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: auto; margin: 0 auto; }
@media (min-width: 600px) {
  .app { position: relative; top: auto; right: auto; bottom: auto; left: auto; height: min(920px, 96dvh); }
}
.screen-main > .topbar, .screen-main > .tabbar { flex-shrink: 0; }
.tabbar { position: relative; z-index: 20; }
/* L'onglet Poki : la scène absorbe la place restante, le reste ne bouge jamais */
.view-poki { overflow: hidden; }
.view-poki > :not(.stage) { flex-shrink: 0; }
.stage { flex: 1 1 0; min-height: 0; container-type: size; }
@supports (width: 1cqh) {
  #avatar-mount { width: min(78vw, 300px, 92cqh); }
}
/* Carnet & Réglages : un cran plus compacts sur les écrans courts (zones de sécurité comprises) */
@media (max-height: 700px) {
  .idcard { padding: 10px 12px; gap: 10px; }
  .idcard img { width: 64px; height: 64px; }
  .tags { margin-top: 6px; }
  .stat { padding: 5px 9px; }
  .view-settings { gap: 4px; }
  .setting { padding: 7px 12px; }
  .view-settings .sec-title { margin-top: 2px; }
}
@media (max-height: 600px) {
  .idcard img { width: 54px; height: 54px; }
  .idcard-name { font-size: 1.05rem; }
  .statgrid { gap: 4px; }
}

/* =========================================================================
   v1.6 — CARTES POKI & POKIDECK
   La carte est dessinée en « cqw » (% de sa largeur) : la même carte
   s'affiche en miniature (Carnet, Pokideck) ou en grand (plein écran).
   ========================================================================= */
.tabbar { grid-template-columns: repeat(4, 1fr); }

.pcard { container-type: inline-size; width: 100%; aspect-ratio: 5 / 7; border-radius: 5cqw; padding: 3cqw; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--c1), var(--c2)); box-shadow: 0 2cqw 6cqw rgba(0,0,0,.35), inset 0 0 0 .8cqw rgba(255,255,255,.35); color: #1c1930; text-align: left; font-family: var(--font); }
.pc-inner { height: 100%; border-radius: 3cqw; background: #fffaf2; display: flex; flex-direction: column; gap: 1.3cqw; padding: 3cqw 3.2cqw 2.6cqw; overflow: hidden; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; }
.pc-name { font-size: 7.4cqw; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-type { flex-shrink: 0; font-size: 3.2cqw; font-weight: 800; color: #fff; background: var(--type); padding: 1cqw 2.4cqw; border-radius: 99px; }
.pc-art { position: relative; flex: 0 0 auto; aspect-ratio: 16 / 11; border-radius: 2.6cqw; overflow: hidden; box-shadow: inset 0 0 0 .6cqw rgba(0,0,0,.08); display: grid; place-items: end center; }
.pc-art img { width: 78%; height: auto; margin-bottom: -6%; filter: drop-shadow(0 1.5cqw 2cqw rgba(0,0,0,.25)); }
.scene-maison { background: radial-gradient(70% 45% at 50% 100%, #e8b98a 0 55%, transparent 56%), linear-gradient(#ffe8c9, #f7cf9f); }
.scene-prairie { background: radial-gradient(90% 40% at 50% 105%, #7fcf6b 0 60%, transparent 61%), radial-gradient(14% 10% at 80% 22%, #ffffff77 0 70%, transparent 71%), linear-gradient(#bfe7ff, #e6f6ff); }
.scene-desert { background: radial-gradient(90% 40% at 50% 105%, #e9c27a 0 60%, transparent 61%), radial-gradient(10% 10% at 82% 20%, #fde68a 0 70%, transparent 71%), linear-gradient(#ffe2b3, #ffd08a); }
.scene-eau { background: radial-gradient(4% 4% at 18% 30%, #ffffffaa 0 60%, transparent 70%), radial-gradient(3% 3% at 26% 18%, #ffffff88 0 60%, transparent 70%), radial-gradient(5% 5% at 82% 26%, #ffffff88 0 60%, transparent 70%), linear-gradient(#7dd3fc, #0e7490); }
.scene-ciel { background: radial-gradient(22% 9% at 24% 26%, #ffffff 0 70%, transparent 71%), radial-gradient(18% 7% at 76% 18%, #ffffffcc 0 70%, transparent 71%), linear-gradient(#a5d8ff, #e0f2fe); }
.scene-foret { background: radial-gradient(90% 40% at 50% 105%, #4d7c0f 0 60%, transparent 61%), radial-gradient(30% 50% at 10% 70%, #65a30d88 0 60%, transparent 61%), radial-gradient(30% 50% at 92% 66%, #65a30d88 0 60%, transparent 61%), linear-gradient(#d9f99d, #bef264); }
.pc-sub { font-size: 2.9cqw; color: #6b6480; font-style: italic; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-label { display: block; font-size: 2.3cqw; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9a93ab; }
.pc-traits { list-style: none; display: grid; gap: 1cqw; margin-top: .8cqw; }
.pc-traits li { display: flex; align-items: center; gap: 1.8cqw; font-size: 2.8cqw; color: #4a4560; line-height: 1.25; }
.pc-chip { flex-shrink: 0; color: #fff; font-weight: 800; font-size: 2.7cqw; padding: .6cqw 2cqw; border-radius: 99px; }
.pc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; }
.pc-row b { display: flex; align-items: center; gap: 1cqw; font-size: 3.2cqw; margin-top: .4cqw; }
.pc-sw i { display: inline-block; width: 3.6cqw; height: 3.6cqw; border-radius: 1cqw; box-shadow: inset 0 0 0 .3cqw rgba(0,0,0,.15); }
.pc-sw i.eye { border-radius: 50%; }
.pcard .pc-lore { margin: 0; font-size: 2.8cqw; color: #6b6480; font-style: italic; line-height: 1.3; border-top: .3cqw dashed #e6dccd; padding-top: 1.4cqw; flex: 1; min-height: 0; overflow: hidden; }
.pc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; }
.pc-meta b { display: block; font-size: 3.3cqw; }
.pc-num { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 2.6cqw; font-weight: 700; color: #4a4560; margin-top: 1cqw; letter-spacing: .04em; }
.pc-brand { display: block; font-size: 2.3cqw; font-weight: 800; color: var(--type); margin-top: .6cqw; letter-spacing: .06em; }
.pc-qr { flex-shrink: 0; width: 20cqw; height: 20cqw; background: #fff; border-radius: 1.6cqw; padding: 1.2cqw; box-shadow: inset 0 0 0 .3cqw #eadfce; display: grid; place-items: center; }
.pc-qr svg { width: 100%; height: 100%; display: block; }
.pc-qr span { font-size: 2.2cqw; text-align: center; color: #9a93ab; font-weight: 700; }
/* Reflet holographique en plein écran */
.card-stage .pcard::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); background-size: 250% 100%; animation: holo 4.5s ease-in-out infinite; mix-blend-mode: soft-light; }
@keyframes holo { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }

/* Carnet : mini-carte cliquable */
.idcard { align-items: stretch; }
.mini-card { flex-shrink: 0; width: clamp(64px, 11dvh, 96px); padding: 0; border-radius: 10px; transition: transform .2s var(--ease); }
.mini-card:active { transform: scale(.95) rotate(-2deg); }
.mini-card .pcard { box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.idcard-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.card-link { align-self: flex-start; margin-top: 8px; font-size: .8rem; font-weight: 800; color: #ffb199; padding: 0; }

/* Carte en plein écran */
.card-view { position: absolute; inset: 0; z-index: 48; background: rgba(4,6,14,.86); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); animation: fade .25s; }
.card-stage { width: min(92vw, calc((100dvh - 140px) * 5 / 7), 420px); animation: card-in .45s var(--ease); }
@keyframes card-in { from { transform: scale(.85) rotate(-4deg); opacity: 0; } }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.card-actions .btn { padding: 12px 18px; }

/* Pokideck */
.view-deck { overflow: hidden; }
.deck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.deck-title { font-size: 1.15rem; letter-spacing: -.02em; }
.deck-head small { color: var(--text-3); font-size: .78rem; font-weight: 700; }
.deck-grid { flex: 1; min-height: 0; display: grid; gap: 8px; align-content: start; overflow: hidden; }
.deck-item { padding: 0; border-radius: 9px; transition: transform .15s var(--ease); }
.deck-item:active { transform: scale(.95); }
.deck-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; color: var(--text-2); padding: 0 16px; }
.deck-empty[hidden] { display: none !important; }
.deck-empty-ico { font-size: 3rem; }
.deck-empty b { color: var(--text); font-size: 1.05rem; }
.deck-empty p { font-size: .88rem; max-width: 30ch; }
.deck-pager { display: flex; align-items: center; justify-content: center; gap: 16px; flex-shrink: 0; font-weight: 800; font-size: .88rem; color: var(--text-2); }
.deck-pager button { width: 38px; height: 34px; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 1.3rem; font-weight: 800; }
.deck-pager button:disabled { opacity: .3; }
#btn-scan { flex-shrink: 0; }

/* Aperçu avant ajout */
.addcard-preview { width: min(62vw, calc((100dvh - 330px) * 5 / 7), 280px); align-self: center; }
.addcard-preview:empty { display: none; }

/* Scanner */
.scanner { position: absolute; inset: 0; z-index: 49; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 16px calc(var(--safe-b) + 18px); }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; top: 50%; left: 50%; width: min(66vw, 260px); aspect-ratio: 1; transform: translate(-50%, -58%); border-radius: 24px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); border: 3px solid rgba(255,255,255,.85); }
.scan-frame::after { content: ""; position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; background: var(--coral); border-radius: 3px; box-shadow: 0 0 12px var(--coral); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 50% { top: 88%; } }
.scan-msg { position: relative; color: #fff; font-weight: 700; text-align: center; margin-bottom: 14px; max-width: 32ch; text-shadow: 0 2px 8px #000; }
.scan-actions { position: relative; display: flex; gap: 10px; }
.code-like { font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .1em; text-align: center; font-size: 1.1rem; }

@media (max-height: 700px) {
  .tabbar button { font-size: .64rem; }
  .card-link { margin-top: 4px; }
}
/* Carnet : mini-carte et fiche compactes sur les écrans courts */
.idcard-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 760px) { .mini-card { width: 54px; } .idcard { padding: 8px 12px; } .idcard .tags { margin-top: 4px; } .card-link { margin-top: 3px; font-size: .76rem; } }
@media (max-height: 600px) { .mini-card { width: 46px; } .idcard .tags span { padding: 2px 8px; font-size: .66rem; } }
@media (max-height: 600px) { .card-link { display: none; } }

/* =========================================================================
   v1.7 — Personnalités : sélecteur de 3 traits (57 traits en 4 catégories)
   ========================================================================= */
.cstep-traits { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.create-body:has(.cstep-traits:not([hidden])) { display: flex; flex-direction: column; overflow: hidden; }
.create-body:has(.cstep-traits:not([hidden])) .cstep-traits { flex: 1; min-height: 0; }
.trait-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex-shrink: 0; }
.trait-tray.shake { animation: trayShake .3s ease-in-out 2; }
@keyframes trayShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tray-slot { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 7px 8px; border-radius: 12px; font-size: .78rem; font-weight: 800; background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 0 0 0 2px var(--c); color: #fff; text-align: left; }
.tray-slot span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-slot small, .tchip small { flex-shrink: 0; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: var(--night); display: grid; place-items: center; font-size: .66rem; font-weight: 800; }
.tray-slot i { font-style: normal; opacity: .7; }
.tray-slot.empty { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 2px rgba(255,255,255,.1); color: var(--text-3); font-weight: 700; }
.tray-slot.empty small { background: rgba(255,255,255,.12); color: var(--text-3); }
.perso-mini { font-size: .74rem; font-weight: 700; color: var(--text-3); min-height: 1.2em; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trait-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: rgba(255,255,255,.05); border-radius: 14px; padding: 4px; flex-shrink: 0; }
.ttab i { display: block; font-style: normal; font-size: 1rem; line-height: 1.1; }
.ttab { position: relative; padding: 5px 2px; border-radius: 10px; font-size: .64rem; font-weight: 800; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttab.on { background: #fff; color: var(--night); }
.ttab b { position: absolute; top: 1px; right: 3px; min-width: 15px; height: 15px; border-radius: 99px; background: var(--coral); color: #fff; font-size: .6rem; display: grid; place-items: center; }
.trait-panel { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 2px 1px 6px; }
.trow { display: flex; flex-wrap: wrap; gap: 5px; padding-left: 9px; position: relative; }
.trow::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: var(--c, #fff3); }
.tchip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.07); color: var(--text-2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, transparent); transition: background .15s, color .15s; }
.tchip.on { background: var(--c); color: #fff; box-shadow: none; }
/* Étape 4 : aperçu de la personnalité */
.perso-card { margin-top: 14px; background: rgba(255,255,255,.05); border-radius: 18px; padding: 14px; display: grid; gap: 8px; }
.perso-label { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
#perso-title { font-size: 1.05rem; color: #ffb199; line-height: 1.25; }
.perso-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.perso-chips span { font-size: .72rem; font-weight: 800; color: #fff; background: var(--c); padding: 3px 10px; border-radius: 99px; }
#perso-lines { list-style: none; display: grid; gap: 5px; }
#perso-lines li { font-size: .86rem; color: var(--text-2); padding-left: 14px; position: relative; line-height: 1.35; }
#perso-lines li::before { content: "•"; position: absolute; left: 2px; color: var(--coral); }
/* Cartes : personnalité */
.pc-art { aspect-ratio: 4 / 3; } /* +1/3 de hauteur : tête entière */
.pc-perso .pc-title { display: block; font-size: 3.5cqw; line-height: 1.2; color: var(--c2); margin-top: .3cqw; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 1cqw; }
.pc-chips .pc-chip { font-size: 2.5cqw; }
.pc-lines { list-style: none; flex: 1; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: .7cqw; border-top: .3cqw dashed #e6dccd; padding-top: 1.2cqw; }
.pc-lines li { font-size: 2.85cqw; line-height: 1.28; color: #4a4560; padding-left: 2.6cqw; position: relative; }
.pc-lines li::before { content: "◆"; position: absolute; left: 0; color: var(--type); font-size: 1.8cqw; top: .4cqw; }
.pc-qr { width: 17cqw; height: 17cqw; }
@media (max-height: 700px) {
  .tchip { padding: 6px 9px; font-size: .76rem; }
  .trait-panel { gap: 5px; }
  .tray-slot { padding: 6px; font-size: .72rem; }
}
@media (max-width: 360px) {
  .tray-slot i { display: none; }
  .tray-slot { padding: 6px 5px; gap: 4px; }
  .ttab { font-size: .58rem; }
}

/* v1.7.1 — image agrandie : pied de carte compact (humeur, pelage, date, N° à gauche du QR) */
.pc-meta { min-width: 0; flex: 1; }
.pc-meta .pc-row { margin-bottom: 1.2cqw; }
.pc-meta > b { font-size: 3cqw; }
.pc-num { margin-top: .6cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-num .pc-brand { display: inline; font-style: normal; margin: 0; }

/* =========================================================================
   v1.8 — Sélecteur de races (chiens LOF, chats LOOF, NAC)
   ========================================================================= */
.cstep-breeds { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.create-body:has(.cstep-breeds:not([hidden])) { display: flex; flex-direction: column; overflow: hidden; }
.create-body:has(.cstep-breeds:not([hidden])) .cstep-breeds { flex: 1; min-height: 0; }
.breed-tabs { grid-template-columns: repeat(3, 1fr); }
.breed-tabs .ttab { font-size: .72rem; }
.breed-search { flex-shrink: 0; width: 100%; padding: 9px 14px; border-radius: 12px; border: 0; background: rgba(255,255,255,.07); color: var(--text); font: inherit; font-size: .88rem; outline: none; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.08); }
.breed-search:focus { box-shadow: inset 0 0 0 2px var(--coral); }
.breed-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 1px 6px; }
.bsec { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 6px; }
.bsec:first-child { margin-top: 0; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.btile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 7px; border-radius: 14px; background: rgba(255,255,255,.05); color: var(--text-2); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.06); transition: background .15s, box-shadow .15s; }
.btile img { width: 50px; height: 50px; }
.btile span { font-size: .64rem; font-weight: 800; line-height: 1.15; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.btile small { position: absolute; top: 4px; left: 5px; font-size: .56rem; font-weight: 800; color: var(--text-3); }
.btile.on { background: color-mix(in srgb, var(--coral) 22%, transparent); box-shadow: inset 0 0 0 2px var(--coral); color: #fff; }
.bempty { text-align: center; padding: 16px 8px; }
.pedigree { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px; background: rgba(255,255,255,.05); font-size: .8rem; font-weight: 700; color: var(--text-2); }
.pedigree[hidden] { display: none; }
.pedigree b { color: #fff; }
.seg { display: flex; gap: 4px; }
.seg button { padding: 6px 10px; border-radius: 10px; font-size: .74rem; font-weight: 800; background: rgba(255,255,255,.07); color: var(--text-2); }
.seg button.on { background: #fff; color: var(--night); }
.statgrid .stat b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) {
  .bgrid { grid-template-columns: repeat(3, 1fr); }
  .btile img { width: 50px; height: 50px; }
  .seg button { padding: 6px 8px; }
}
