/* ==========================================================================
   Woremixe — Pages applicatives (espace joueur, administration, connexion, article)
   ========================================================================== */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.cms-page { background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.cms-page > main, .cms-page > .app-shell { flex: 1; }

/* ---------- Barre applicative ---------- */
.user-chip { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px 0 4px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .03); font-size: 13.5px; font-weight: 600; }
.user-chip .avatar { width: 30px; height: 30px; }
.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8fd9ff, var(--blue) 40%, var(--violet-2) 85%); color: #fff; font: 700 13px/1 var(--display); box-shadow: 0 0 0 2px rgba(5, 6, 12, .9), 0 0 0 3px rgba(120, 180, 255, .5); text-transform: uppercase; }

/* ---------- Bannière de page ---------- */
.app-hero { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--border); }
.app-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("/assets/nebula.webp") 70% 45% / cover no-repeat; opacity: .55; }
.app-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--bg) 10%, rgba(5, 6, 12, .6) 60%, rgba(5, 6, 12, .85)), linear-gradient(180deg, transparent 40%, var(--bg)); }
.app-hero-inner { display: flex; align-items: center; gap: 24px; padding-block: 44px 40px; }
.hero-avatar { position: relative; width: 88px; height: 88px; flex: none; display: grid; place-items: center; }
.hero-avatar::before { content: ""; position: absolute; inset: 8px; transform: rotate(45deg); border-radius: 16px; border: 1px solid rgba(190, 210, 255, .6); background: radial-gradient(circle at 35% 30%, rgba(143, 217, 255, .9), var(--blue) 35%, var(--violet-2) 75%, #120833); box-shadow: 0 0 40px rgba(26, 140, 255, .45), inset 0 0 18px rgba(255, 255, 255, .25); }
.hero-avatar svg { position: relative; width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cms-heading .eyebrow { margin-bottom: 10px; }
.cms-heading h1 { font-size: clamp(28px, 4vw, 44px); }
.cms-heading p { margin-top: 8px; color: var(--text-2); }

/* ---------- Mise en page à barre latérale (style portail) ---------- */
.app-shell { padding-block: 32px 64px; }
.app-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.app-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.cms-tabs { display: grid; gap: 4px; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.side-label { padding: 10px 12px 6px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.cms-tabs a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; transition: background-color .15s, color .15s; }
.cms-tabs a .i { color: var(--text-3); transition: color .15s; }
.cms-tabs a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.cms-tabs a[aria-current="page"] { background: linear-gradient(90deg, rgba(26, 140, 255, .18), rgba(26, 140, 255, .04)); color: #fff; }
.cms-tabs a[aria-current="page"] .i { color: var(--blue-hi); }
.cms-tabs a[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.side-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(141, 99, 255, .14), var(--surface) 60%); }
.side-card strong { display: block; font: 700 15px/1.3 var(--display); }
.side-card p { margin: 6px 0 14px; color: var(--text-2); font-size: 13px; }
.side-card .button { width: 100%; }

.app-main { min-width: 0; }
.cms-view { animation: viewIn .35s var(--ease); }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.cms-view h2, .cms-panel h2 { font-size: 22px; line-height: 1.25; }
.view-head p { margin-top: 4px; color: var(--text-2); font-size: 14px; }

/* ---------- Panneaux / grilles ---------- */
.cms-panel { position: relative; min-width: 0; padding: 26px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.cms-panel > h2 { margin-bottom: 18px; }
.cms-panel h3 { margin: 4px 0 14px; font: 600 16px/1.3 var(--sans); }
.cms-panel > p { color: var(--text-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.cms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cms-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-gap { margin-top: 24px; }
.divider { height: 1px; margin: 26px 0; background: var(--border); border: 0; }

/* KPI */
#stats { gap: 16px; }
#stats:has(> :nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { position: relative; overflow: hidden; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); transition: border-color .2s; }
.stat:hover { border-color: var(--border-2); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(26, 140, 255, .18), transparent 70%); }
.stat:nth-child(2)::after { background: radial-gradient(circle, rgba(141, 99, 255, .2), transparent 70%); }
.stat:nth-child(3)::after { background: radial-gradient(circle, rgba(62, 226, 155, .16), transparent 70%); }
.stat:nth-child(4)::after { background: radial-gradient(circle, rgba(234, 181, 77, .18), transparent 70%); }
.stat > span { display: block; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.stat > strong { display: block; margin-top: 8px; font: 700 32px/1.1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat > small { color: var(--text-3); }

.publish-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(120deg, rgba(26, 140, 255, .14), transparent 55%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.publish-card h2 { margin-bottom: 6px; }
.publish-card p { color: var(--text-2); max-width: 560px; }

/* ---------- Formulaires ---------- */
label, .cms-label { display: grid; gap: 8px; margin-bottom: 18px; color: var(--text-2); font-size: 13px; font-weight: 600; }
input, textarea, select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: rgba(3, 4, 9, .6); color: var(--text);
  font: 400 15px/1.4 var(--sans);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: #5f6582; }
input:hover, textarea:hover, select:hover { border-color: var(--border-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); background: rgba(3, 4, 9, .85); box-shadow: 0 0 0 3px rgba(26, 140, 255, .25); }
input:user-invalid, textarea:user-invalid { border-color: rgba(255, 95, 114, .7); }
textarea { resize: vertical; line-height: 1.65; }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; width: 40px; min-height: 0; height: 22px; padding: 0; flex: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); cursor: pointer; transition: background-color .2s; }
input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c5cae0; transition: transform .2s var(--ease), background-color .2s; }
input[type="checkbox"]:checked { background: var(--blue); border-color: rgba(120, 190, 255, .6); }
input[type="checkbox"]:checked::after { transform: translateX(18px); background: #fff; }
input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px rgba(26, 140, 255, .35); }
.check-label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: rgba(255, 255, 255, .02); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.form-help { color: var(--text-3); font-size: 13px; font-weight: 400; line-height: 1.6; }
.cms-panel form .form-help { margin: -6px 0 18px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
#search-form { display: flex; align-items: end; gap: 12px; }
#search-form label { flex: 1; margin: 0; }
button:disabled { opacity: .55; cursor: wait; }

/* ---------- Avis ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border: 1px solid rgba(62, 226, 155, .35); border-left-width: 3px; border-radius: var(--r); background: rgba(62, 226, 155, .08); color: #c6f5dd; font-size: 14px; }
.notice::before { content: "✓"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(62, 226, 155, .2); font-size: 12px; font-weight: 700; }
.notice.error { border-color: rgba(255, 95, 114, .45); background: rgba(255, 95, 114, .08); color: #ffd0d6; }
.notice.error::before { content: "!"; background: rgba(255, 95, 114, .25); }
.notice:focus { outline: none; }

/* ---------- Personnages (classes WoW) ---------- */
.character-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.character-card {
  --cls: #8a90ab;
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 0 0 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.character-card::before { content: ""; height: 86px; margin-bottom: -44px; background: radial-gradient(circle at 20% 130%, color-mix(in srgb, var(--cls) 60%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--cls) 22%, var(--surface-2)), var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--cls) 25%, transparent); }
.character-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cls) 55%, transparent); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 18px 50px -24px var(--cls); }
.character-card > * { margin-inline: 20px; }
.class-rune { position: relative; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 14px; border: 2px solid var(--cls); background: color-mix(in srgb, var(--cls) 18%, #07080f); color: var(--cls); font: 700 22px/1 var(--display); box-shadow: 0 0 24px color-mix(in srgb, var(--cls) 40%, transparent); }
.character-card small { position: absolute; top: 14px; right: 0; margin: 0 14px; padding: 4px 10px; border-radius: 999px; background: rgba(5, 6, 12, .65); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.character-card h3 { margin-top: 10px; font-size: 20px; color: color-mix(in srgb, var(--cls) 45%, white); }
.character-card > span:not(.class-rune) { color: var(--text-2); font-size: 13.5px; }
.character-card p { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.character-card p::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.character-card[data-online="1"] p::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.character-card b { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--blue-hi); font-size: 13px; font-weight: 600; }
[data-class="1"] { --cls: #c69b6d; } [data-class="2"] { --cls: #f48cba; } [data-class="3"] { --cls: #aad372; }
[data-class="4"] { --cls: #fff468; } [data-class="5"] { --cls: #e8e8f0; } [data-class="6"] { --cls: #e04a5a; }
[data-class="7"] { --cls: #2e8cff; } [data-class="8"] { --cls: #3fc7eb; } [data-class="9"] { --cls: #9a7ff0; }
[data-class="11"] { --cls: #ff7c0a; }

#character-detail:not([data-class]) { --cls: var(--blue); }
.detail-head { display: flex; align-items: center; gap: 16px; margin: -26px -26px 24px; padding: 24px 26px; border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; background: radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--cls) 30%, transparent), transparent 55%), color-mix(in srgb, var(--cls) 6%, var(--surface-2)); }
.detail-head h2 { margin: 0 !important; color: color-mix(in srgb, var(--cls) 40%, white); font-size: 28px !important; }
.detail-head p { color: var(--text-2); font-size: 14px; }
.detail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.detail-list > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: rgba(255, 255, 255, .02); }
.detail-list dt { color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.detail-list dd { margin: 4px 0 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
#account-info { margin-bottom: 8px; }

/* ---------- Tableaux / listes admin ---------- */
.cms-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.cms-table-wrap:has(> .empty), .cms-table-wrap:empty { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
thead th { position: sticky; top: 0; background: var(--surface-3); color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tbody tr:last-child td { border-bottom: 0; }
.cms-table-wrap td { max-width: 340px; overflow-wrap: anywhere; }
td:first-child { color: var(--text-3); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, .04); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.pill-ok { color: #9ff0c8; border-color: rgba(62, 226, 155, .35); background: rgba(62, 226, 155, .1); }
.pill-draft { color: #ffd98f; border-color: rgba(234, 181, 77, .35); background: rgba(234, 181, 77, .1); }
#page-number { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.admin-columns { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
#article-list { display: grid; gap: 6px; max-height: 620px; overflow-y: auto; }
.article-row { display: grid; gap: 6px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: rgba(255, 255, 255, .02); text-align: left; transition: border-color .15s, background-color .15s; }
.article-row:hover { border-color: var(--border-2); background: rgba(255, 255, 255, .05); }
.article-row.active { border-color: rgba(90, 174, 255, .5); background: rgba(26, 140, 255, .1); }
.article-row strong { font-weight: 600; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.article-row span { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; }

/* ---------- Connexion (écran partagé façon launcher) ---------- */
.auth-page { background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.auth-art { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: 40px clamp(24px, 5vw, 64px); border-right: 1px solid var(--border); }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("/assets/nebula.webp") center / cover; opacity: .85; }
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 6, 12, .5), rgba(5, 6, 12, .15) 40%, rgba(5, 6, 12, .9)); }
.auth-art .auth-logo { width: min(520px, 90%); margin: 20px auto; mix-blend-mode: lighten; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .7)); animation: float 8s ease-in-out infinite; }
.auth-perks { display: grid; gap: 10px; max-width: 460px; margin: 0; padding: 0; list-style: none; }
.auth-perks li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r); background: rgba(5, 6, 12, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--text-2); font-size: 14px; }
.auth-perks .i { color: var(--blue-hi); }
.auth-side { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 5vw, 72px); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.auth-wrap { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-brand { display: none; margin: 0 auto 20px; max-width: 240px; }
.auth-brand img { width: 100%; mix-blend-mode: lighten; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 36px; color: var(--text-3); font-size: 14px; }
.auth-back:hover { color: var(--text); }
.auth-panel { padding: 0; border: 0; background: none; }
.auth-panel h1 { margin: 0 0 6px; font-size: 32px; }
.auth-panel > .form-help { margin-bottom: 4px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 28px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.auth-tabs button { height: 40px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font-size: 14px; font-weight: 600; transition: background-color .2s, color .2s; }
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button[aria-selected="true"] { background: var(--surface-3); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 8px rgba(0, 0, 0, .3); }
.auth-panel form { margin-top: 24px; }
.auth-panel form .button { width: 100%; margin-top: 6px; }
.auth-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }

/* ---------- Article ---------- */
.article-hero .app-hero-inner { display: block; padding-block: 36px 56px; }
.article-shell { max-width: 820px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.back-link:hover { color: #fff; }
#article { margin-top: -40px; position: relative; }
#article .eyebrow { margin-bottom: 14px; }
.article-title { font-size: clamp(30px, 5vw, 52px) !important; line-height: 1.12 !important; overflow-wrap: anywhere; }
#article-summary { margin-top: 18px; color: var(--text-2); font-size: 19px; line-height: 1.6; }
#article-summary:empty { display: none; }
.article-body { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; color: #d7dbee; font-size: 17px; line-height: 1.85; }

/* ---------- Pied de page applicatif ---------- */
.cms-footer { padding: 22px var(--gutter); border-top: 1px solid var(--border); background: var(--bg-2); color: var(--text-3); font-size: 13px; text-align: center; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  #stats:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-columns { grid-template-columns: 1fr; }
  #article-list { max-height: 320px; }
}
@media (max-width: 960px) {
  .app-layout { grid-template-columns: 1fr; gap: 20px; }
  .app-side { position: static; }
  .cms-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .cms-tabs::-webkit-scrollbar { display: none; }
  .cms-tabs a { flex: none; }
  .cms-tabs a[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: -8px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .side-label, .side-card { display: none; }
  .cms-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-brand { display: block; }
  .auth-back { margin-bottom: 20px; }
  .topbar .user-chip { display: none; }
}
@media (max-width: 640px) {
  .app-hero-inner { gap: 14px; padding-block: 28px; }
  .hero-avatar { width: 64px; height: 64px; }
  .hero-avatar svg { width: 26px; height: 26px; }
  .cms-grid, .cms-grid.three, #stats:has(> :nth-child(5)) { grid-template-columns: 1fr; }
  #stats.cms-grid.three, #stats:has(> :nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 16px; }
  .stat > strong { font-size: 24px; }
  .cms-panel { padding: 20px; }
  .detail-head { margin: -20px -20px 20px; padding: 20px; }
  .publish-card { flex-direction: column; align-items: flex-start; }
  #search-form { flex-direction: column; align-items: stretch; }
  .topbar .desktop-nav { display: none; }
  .auth-side { padding-top: 24px; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cms-view, .auth-art .auth-logo { animation: none; }
}



/* ---------- Portraits de personnage (photo de profil) ---------- */
.portrait:not([data-class]), .avatar-option:not([data-class]) { --cls: var(--blue); }
.portrait { --ring: #d9a948; --size: 44px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cls) 55%, #fff 8%), color-mix(in srgb, var(--cls) 30%, #0a0b14) 62%, #07080f);
  box-shadow: 0 0 0 2px #1a1206, 0 0 0 calc(var(--size) * .045 + 1px) var(--ring), 0 0 calc(var(--size) * .35) color-mix(in srgb, var(--cls) 45%, transparent), inset 0 -8px 18px rgba(0, 0, 0, .45); }
.portrait::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 50%; background: radial-gradient(circle at 35% 20%, rgba(255, 255, 255, .22), transparent 45%); pointer-events: none; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; transition: opacity .25s; }
.portrait.has-image img { opacity: 1; }
.portrait.has-image .portrait-fallback, .portrait.no-image img { display: none; }
.portrait-fallback { position: relative; z-index: 1; color: #fff; font: 700 calc(var(--size) * .42)/1 var(--display); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.portrait-empty { --ring: #4a5070; background: var(--surface-3); }
.portrait-empty .portrait-fallback { color: var(--text-3); }
.portrait-xs { --size: 30px; box-shadow: 0 0 0 2px var(--ring); }
.portrait-md { --size: 46px; }
.portrait-card { --size: 64px; }
.portrait-lg { --size: 76px; }
.portrait-hero { --size: 80px; }
.portrait-xl { --size: 132px; }

.user-chip { color: var(--text); transition: border-color .2s, background-color .2s; }
.user-chip:hover { border-color: var(--border-2); background: rgba(255, 255, 255, .06); }
#user-avatar { display: contents; }
.hero-portrait-link { flex: none; display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; transition: transform .25s var(--ease); }
.hero-portrait-link:hover { transform: scale(1.05); }

.character-card .portrait-card { margin-top: 0; }
.detail-head .portrait { margin: 0; }

.avatar-panel { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); gap: 28px; align-items: start;
  background: radial-gradient(circle at 0% 0%, rgba(234, 181, 77, .1), transparent 45%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.avatar-current { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px; text-align: center; border: 1px solid var(--border); border-radius: var(--r-lg); background: rgba(0, 0, 0, .25); }
.avatar-current h2 { margin: 10px 0 4px !important; font-size: 24px !important; }
.avatar-current .form-help { margin: 0 0 14px !important; }
.avatar-choose h3 { margin-top: 0; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.avatar-option { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: rgba(255, 255, 255, .02); text-align: left; transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.avatar-option:hover { border-color: color-mix(in srgb, var(--cls) 50%, transparent); background: color-mix(in srgb, var(--cls) 8%, transparent); transform: translateY(-2px); }
.avatar-option strong { display: block; font-size: 14px; color: color-mix(in srgb, var(--cls) 40%, white); }
.avatar-option small { color: var(--text-3); font-size: 12px; }
.avatar-option[aria-checked="true"] { border-color: var(--gold); background: rgba(234, 181, 77, .1); box-shadow: 0 0 0 1px rgba(234, 181, 77, .4), 0 8px 24px rgba(234, 181, 77, .12); }
.avatar-option[aria-checked="true"]::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #1d1406; font-size: 12px; font-weight: 800; }
.avatar-option.is-saving { opacity: .6; }
#avatar-status { min-height: 22px; margin-top: 10px; }
@media (max-width: 960px) { .avatar-panel { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .portrait-xl { --size: 104px; } .avatar-picker { grid-template-columns: 1fr; } }

/* Boutique (administration) */
.admin-shop-tabs { margin-top: 4px; }
.admin-list { display: grid; gap: 6px; max-height: 640px; overflow-y: auto; }
.admin-list .article-row span { flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.inline-select { display: flex; align-items: center; gap: 10px; margin: 0; }
.inline-select select { min-height: 38px; width: auto; }
.config-warn { color: #ffd98f !important; }
.admin-wallet { box-shadow: none; }
select { appearance: auto; }

/* Installation de la boutique */
.check-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: rgba(255, 255, 255, .02); }
.check-list strong { display: block; font-size: 14px; font-weight: 600; }
.check-list small { color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.check-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.check-list li.is-ok { border-color: rgba(62, 226, 155, .3); }
.check-list li.is-ok .check-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.check-list li.is-todo { border-color: rgba(234, 181, 77, .3); }
.check-list li.is-todo .check-dot { background: var(--gold); box-shadow: 0 0 10px rgba(234, 181, 77, .6); }
.test-result { min-height: 22px; margin: 10px 0 0; font-size: 13.5px; }
.test-result.is-pending { color: var(--text-3); }
.test-result.is-ok { color: #9ff0c8; }
.test-result.is-error { color: #ffb3bd; }
.token-reveal { margin-top: 14px; padding: 14px; border: 1px solid rgba(234, 181, 77, .4); border-radius: var(--r); background: rgba(234, 181, 77, .08); }
.token-reveal strong { display: block; margin-bottom: 10px; font-size: 13.5px; color: #ffd98f; }
.token-reveal code { font-size: 12.5px; }
.scope-list { display: grid; gap: 8px; margin-bottom: 8px; }
.code-block { margin: 0; padding: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: rgba(3, 4, 9, .6); color: #b9c4e6; font: 12.5px/1.7 var(--mono); white-space: pre; }
#token-list table { min-width: 620px; }
#token-list td, #token-list th { white-space: nowrap; }
.token-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
@media (max-width: 1180px) { .token-layout { grid-template-columns: 1fr; } }
