
/* Portes : les deux battants proviennent de l’image d’origine. */
#royalGate.passage-gate {
  position:fixed;inset:0;isolation:isolate;overflow:hidden;z-index:11000;
  background:radial-gradient(ellipse at center,#42165466 0%,#100819de 82%),url("assets/royal-gates-v2.png") center/cover;
  transition:opacity .42s ease 1.82s;
}
.gate-scene,.gate-aperture,.gate-leaf,.gate-depth {position:absolute}
.gate-scene {
  left:50%;top:50%;width:max(100vw,177.78dvh);aspect-ratio:16/9;
  transform:translate(-50%,-50%);perspective:950px;
  background:url("assets/royal-gates-v2.png") center/100% 100% no-repeat;
  
}
.gate-aperture {
  inset:0;perspective:1100px;
  clip-path:polygon(23.5% 89.8%,23.5% 34%,26% 24%,32% 14%,40% 5.5%,50% 0,60% 5.5%,68% 14%,74% 24%,76.5% 34%,76.5% 89.8%);
}
.gate-depth {
  inset:0;background:radial-gradient(ellipse at 50% 74%,#ba76f39c,transparent 45%),url("assets/royal-hero-v2.png") center/cover;
}
.gate-leaf {top:0;bottom:0;width:50%;background-image:url("assets/royal-gates-v2.png");background-size:200% 100%;transition:transform 1.13s cubic-bezier(.3,.1,.25,1) .32s,filter 1.13s ease .32s;backface-visibility:hidden}
.gate-left {left:0;transform-origin:47% 50%;background-position:left center}
.gate-right {right:0;transform-origin:53% 50%;background-position:right center}
.passage-gate.passing {opacity:0;pointer-events:none}
.passing .gate-left {transform:translateX(-32%) rotateY(54deg);filter:brightness(.63)}
.passing .gate-right {transform:translateX(32%) rotateY(-54deg);filter:brightness(.63)}
.gate-depth {transition:transform .92s cubic-bezier(.28,.6,.34,1) 1.46s}
.passing .gate-depth {transform:scale(2.3)}
.passage-gate::after {content:"";position:absolute;inset:0;background:url("assets/royal-hero-v2.png") center/cover;opacity:0;pointer-events:none;transition:opacity .42s ease 1.63s}
.passage-gate.passing::after {opacity:1}
@media(prefers-reduced-motion:reduce){.gate-depth,.passage-gate::after {transition:none}}
.gate-caption {
  position:absolute;inset:6dvh 6vw auto;text-align:center;color:#fff0bb;
  text-shadow:0 2px 8px #09010a,0 2px 24px #150518,0 1px 4px #030004;
  transition:opacity .28s ease;
}
.gate-caption span {display:inline-block;padding:7px 13px;background:#0f0713db;border-radius:25px;letter-spacing:.08em;font-size:clamp(.75rem,1.35vw,1rem)}
.gate-caption h2 {font:700 clamp(24px,4.5vw,68px)/1 Georgia,serif;letter-spacing:.13em;margin:12px 0}
.passage-gate .gate-enter {position:absolute;bottom:max(5dvh,20px);left:50%;transform:translateX(-50%);padding:8px 17px;min-height:37px;white-space:nowrap;font-size:.86rem}
.passage-gate .gate-sound {position:absolute;bottom:max(2dvh,12px);right:max(2vw,12px);width:42px;height:42px;padding:9px;display:grid;place-items:center;border-radius:50%;background:#150e1fe6;color:#ffdc92;border:1px solid #d5a86188}
.passing :is(.gate-enter,.gate-sound,.gate-caption) {opacity:0}
.royal-header #royalAudio {width:38px;height:38px;padding:8px;min-width:0;display:grid;place-items:center;border-radius:50%}
:is(#royalAudio,#royalSound) svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
:is(#royalAudio,#royalSound)[aria-pressed=false] .sound-wave,:is(#royalAudio,#royalSound)[aria-pressed=true] .sound-muted {display:none}
.royal-header .brand-crest {background:url("assets/correction/embleme.png") center/contain no-repeat;border:0;box-shadow:none;color:transparent}
.royal-header .brand-crest::before,.royal-header .brand-crest::after {display:none}
@media(max-width:600px){
 .gate-scene{width:146vw}
 .gate-caption{inset:15dvh 7vw auto}
}

/* Salon Live et planning */
.diffusion-banner {
  display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:13px;padding:13px 16px;
  border:1px solid #cda55e75;border-radius:12px;
  background:linear-gradient(90deg,#160d21f5 10%,#1d1028d9 56%,#1b1025c9),url("assets/finitions/orb.jpg") center 32%/cover;
}
.diffusion-banner h3,.diffusion-banner p {margin:0 0 5px}
.broadcast-seal {width:52px;aspect-ratio:1;display:grid;place-items:center;border:1px solid #bb9355;border-radius:50%;font-size:26px;color:#ffd78b;box-shadow:inset 0 0 14px #9e53be80}
.broadcast-status {display:inline-flex;align-items:center;gap:5px;padding:3px 8px;font-size:.78rem;border-radius:20px;background:#3c244d;color:#fae7bd}
.broadcast-status::before {content:"";width:6px;height:6px;background:#d4b085;border-radius:50%}
.on-air .broadcast-status::before {background:#f15e74}
.royal-week .schedule-day {position:relative;transition:transform .24s,box-shadow .24s;transform-origin:center 45%;border-radius:8px}
.royal-week .schedule-day:focus-within,.royal-week .schedule-day:has([aria-expanded=true]) {z-index:1;box-shadow:0 0 22px #a55ddc5e}
.schedule-toggle {width:100%;min-height:38px;padding:7px 9px;display:flex;align-items:center;justify-content:space-between;gap:3px;text-align:left;color:#ffe2a4;border:0;border-bottom:1px solid #ad884950;background:#261530;font-weight:750;cursor:pointer}
.schedule-toggle [data-schedule-today] {font-size:.64rem;font-weight:650}
.schedule-now {display:grid;gap:3px;padding:8px 9px;background:linear-gradient(110deg,#1f1228f0,#21132bbe),var(--current-art) center/cover;border-top:1px solid #bd955b86}
.schedule-now[hidden] {display:none}
.schedule-now[data-scene=farm] {--current-art:url("assets/finitions/farm.jpg");box-shadow:inset 0 2px #cf9d54}
.schedule-now[data-scene=factory] {--current-art:url("assets/finitions/factory.jpg");box-shadow:inset 0 2px #997ad7}
.schedule-now[data-scene=event] {--current-art:url("assets/finitions/event.jpg");box-shadow:inset 0 2px #b46fbb}
.schedule-day.is-today .schedule-now[data-scene=farm] {animation:gold-shift 5s ease-in-out infinite}
.schedule-day.is-today .schedule-now[data-scene=factory] {animation:violet-shift 4.5s ease-in-out infinite}
@keyframes gold-shift{50%{box-shadow:inset 0 2px #ffe3a8,inset 0 0 22px #cb934423}}
@keyframes violet-shift{50%{box-shadow:inset 0 2px #c58df3,inset 0 0 20px #a461f035}}
.schedule-now small {font-size:.67rem;color:#e1c596}
.schedule-now strong {font-size:.82rem;color:#fff1cb}
@media(max-width:650px){.diffusion-banner {grid-template-columns:42px minmax(0,1fr);gap:9px;padding:11px}.diffusion-banner .live-actions{grid-column:1/-1}.broadcast-seal{width:38px}}

/* Distinctions et Hall */
.official-hall.honor-compact {background:#130e19;padding:12px;border-radius:12px;border:1px solid #b5905440}
.hall-members .member-portrait-card {border:1px solid #d6ac6a65;border-radius:16px;background:linear-gradient(120deg,#241631,#150d1f)}
.hall-members .member-portrait-card .default-sigil {color:transparent;background:url("assets/correction/embleme.png") center/contain no-repeat}
.honor-family {margin:20px 0 25px}
.honor-family-heading {width:fit-content;max-width:min(100%,510px);margin:0 auto 14px;padding:8px 18px;text-align:center;border:1px solid #c59b5875;background:linear-gradient(130deg,#352040,#211429);border-radius:12px}
.honor-family-heading h3,.honor-family-heading p {margin:3px 0}
.honor-family-heading p {color:#e0cfde;font-size:.86rem}
.honor-family .deluxe-badge-grid {margin:0}

/* Récompenses, fenêtres et pointeur */
.royal-chest {display:grid;justify-items:center;position:relative;isolation:isolate;min-width:90px;padding:3px 5px 4px;gap:0;border:0;background:transparent;color:#ffe9b1;cursor:pointer;font-weight:700;font-size:.72rem}
.chest-coins {position:absolute;inset:0;pointer-events:none}
.chest-coins i {position:absolute;top:32%;left:32%;font:12px serif;color:#ffcf56;opacity:0;text-shadow:0 0 7px #ffda73}
.chest-coins i:nth-child(2){left:62%;--coin-x:19px;--coin-y:-23px}
.chest-coins i:nth-child(3){left:41%;--coin-x:-21px;--coin-y:-31px}
.chest-coins i:nth-child(4){left:53%;--coin-x:29px;--coin-y:-12px}
.royal-chest.opening-chest .chest-coins i {animation:coin-fly .64s ease-out both}
.royal-chest.received {filter:grayscale(.93);opacity:.65;cursor:default}
.chest-progress {font-size:.78rem;color:#e0c59b}
.chest-progress>span {font-size:1.35rem;vertical-align:middle;color:#e5b961}
@keyframes chest-idle {45%{transform:translateY(-3px);filter:drop-shadow(0 0 13px #f9b855aa)}}
@keyframes coin-fly {0%{opacity:1;transform:translate(0,0) scale(.7)}65%{opacity:1}100%{opacity:0;transform:translate(var(--coin-x,-20px),var(--coin-y,-30px)) scale(1.3)}}
#popovers .panel {border:1px solid #ccaa65;border-radius:17px;background:radial-gradient(ellipse at 5% 0%,#472755,#1d1028 56%,#130d1b);box-shadow:0 0 0 4px #100919,0 0 0 5px #b3884655,0 18px 60px #000b}
#popovers #panelTitle {padding-bottom:10px;border-bottom:1px solid #c49b5758;font-family:Georgia,serif}
#popovers #closePanel {width:38px;height:38px;display:grid;place-items:center;border-radius:50%;border:1px solid #cfa55f9c;background:#291638;color:#ffe8ac}
#popovers :is(input,textarea,select):not([type=checkbox],[type=radio],[type=range]) {border-radius:8px;border-color:#b991535f;background:#150c20;color:#f7eaf3}
#popovers :is(button,input,select,textarea,a):focus-visible {outline:2px solid #ffe1a0;outline-offset:2px}
.royal-pointer {position:fixed;inset:0 auto auto 0;z-index:10000;width:1px;height:1px;pointer-events:none;opacity:0;transition:opacity .15s}
.royal-pointer.visible {opacity:.65}
.royal-pointer::before {content:"";position:absolute;inset:-20px;background:radial-gradient(circle,#a557e24b,#7c32c122 38%,transparent 72%);border-radius:50%}
.royal-pointer.interactive::before {inset:-23px;background:radial-gradient(circle,#b96ef467,#953dd631 40%,transparent 73%)}
.royal-pointer i {position:absolute;width:2px;height:2px;background:#ffe19b;border-radius:50%;box-shadow:0 0 5px #e6ad52}
.royal-pointer i:nth-child(1){left:-12px;top:9px}.royal-pointer i:nth-child(2){left:10px;top:-8px}.royal-pointer i:nth-child(3){left:12px;top:11px}
@media(hover:none),(pointer:coarse),(prefers-reduced-motion:reduce){.royal-pointer{display:none}}
@media(prefers-reduced-motion:reduce){
  .gate-scene,.gate-leaf,.passage-gate,.royal-week .schedule-day,.chest-lid {transition:none!important}
  .royal-week .schedule-day:hover {transform:none}
  .royal-chest svg,.royal-chest .chest-coins i,.schedule-day .schedule-now{animation:none!important}
}


/* Appartements et passeport */
.apartment-salon .royal-wallet {gap:8px;margin:8px 0}
.apartment-salon .royal-wallet>span {padding:10px;border-radius:15px;background:linear-gradient(135deg,#432654d9,#1e112cd9);border:1px solid #cd9a6077}
.apartment-salon .royal-wallet strong {font-size:clamp(1.45rem,2.4vw,2rem);margin:2px 0}
.apartment-salon .personal-stats {gap:6px}
.apartment-salon .personal-stats>span {border-radius:11px;padding:6px 3px;background:#1a1022e8;border:1px solid #a07a474d}
.apartment-actions {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.apartment-actions button {border-radius:11px;white-space:normal;min-height:39px}
.apartment-actions [data-final=profile-edit] {color:#21140e;background:linear-gradient(120deg,#f5da95,#c39349)}
.apartment-actions [data-final=security] {background:linear-gradient(120deg,#683c83,#3a204c)}
.apartment-actions [data-final=passport-export] {background:linear-gradient(120deg,#225f50,#143831);border-color:#6eaf94}
.apartment-actions [data-final=logout] {background:linear-gradient(120deg,#6f3247,#391d30);border-color:#aa6d7e}
.apartment-actions button:hover {filter:brightness(1.14)}
.apartment-connections .compact-providers {display:flex;flex-wrap:wrap;gap:7px}
.provider-button,.provider-connected {display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 10px!important;border-radius:11px;min-height:37px!important;font-size:.82rem}
.provider-connected {flex-wrap:wrap}
.provider-button[disabled] {cursor:default;opacity:.75}
.provider-mark svg {display:block;width:18px;height:18px}
.compact-equipment article {border-radius:14px;background:linear-gradient(135deg,#3a2646,#19101f);border:1px solid #c0925e66}
.compact-equipment article .empty-equipment {border-radius:50%;background:radial-gradient(#542f61,#21132d);border:1px solid #a27f515c}
.royal-ritual {border-radius:14px;background:linear-gradient(90deg,#24152df2,#3b2549d4),url("assets/finitions/treasury.jpg") center/cover!important;border:1px solid #c89f5f70;margin:0 0 16px!important;padding:11px 16px!important}
.three-jewels figure {border-radius:18px;border:1px solid #bc8c57a0;background:radial-gradient(ellipse at 50% 65%,#69417563,transparent 68%),linear-gradient(#291735,#160c1d);box-shadow:inset 0 -5px 0 #74532d90}
.three-jewels figure img {height:clamp(86px,12vw,134px)!important}
.favorite-badge-grid label {position:relative;cursor:pointer;border:1px solid #9f805047;border-radius:12px;padding:5px!important}
.favorite-badge-grid label:has(input:checked){border-color:#e7be70;background:#533762;box-shadow:inset 0 0 12px #e5ba4e22}
.favorite-badge-grid label:has(input:focus-visible){outline:2px solid #ffe4a1;outline-offset:2px}
.favorite-badge-grid label input {position:absolute;width:1px;height:1px;opacity:0}
.favorite-badge-grid label:has(input:checked)::after {content:"✓";position:absolute;inset:5px 5px auto auto;border-radius:50%;width:20px;height:20px;background:#ebc77d;color:#1b1122;text-align:center;line-height:20px;font-size:.75rem}
.passport-effects {position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:1}
.passport-effects .passport-aura {opacity:.41!important;filter:drop-shadow(0 0 8px var(--spark-color));object-fit:cover}
.passport-effects i {position:absolute;left:var(--spark-x);top:var(--spark-y);font:var(--spark-size)/1 Georgia,serif;color:var(--spark-color);text-shadow:0 0 9px var(--spark-color);animation:passport-sparks var(--spark-duration) ease-in-out var(--spark-delay) infinite}
@keyframes passport-sparks{0%,100%{opacity:.12;transform:translate(0,0) scale(.55)}45%{opacity:.94;transform:translate(4px,calc(var(--spark-drift)*.45)) scale(1.18)}80%{opacity:.45;transform:translate(-5px,var(--spark-drift)) scale(.8)}}
.passport-ornaments {position:absolute;right:8px;top:26%;display:grid;gap:4px;z-index:2;width:clamp(36px,12%,64px);pointer-events:none}
.passport-ornaments .shop-art {width:100%;height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 1px 5px #140819)}
.royal-passport:has(.passport-ornaments) .passport-identity {padding-inline:clamp(43px,13%,70px)}
@media(max-width:480px){.apartment-actions button{font-size:.76rem}.apartment-salon .personal-stats>span{font-size:.7rem}.three-jewels figure img{height:72px!important}}
@media(prefers-reduced-motion:reduce){.passport-effects i{animation:none;opacity:.42}}

.royal-chest.ready:not(.opening-chest) .chest-coins i {animation:chest-glint 2.8s ease-in-out infinite}
.royal-chest.ready:not(.opening-chest) .chest-coins i:nth-child(2) {animation-delay:-1.4s}
.royal-chest.ready:not(.opening-chest) .chest-coins i:nth-child(3) {animation-delay:-.6s}
.royal-chest.ready:not(.opening-chest) .chest-coins i:nth-child(4) {animation-delay:-2s}
@keyframes chest-glint {0%,80%,100%{opacity:0;transform:translate(0,0) scale(.65)}48%{opacity:.8;transform:translate(calc(var(--coin-x,-20px)*.55),-13px) scale(.8)}}
@media(prefers-reduced-motion:reduce){.royal-chest.ready .chest-coins i{animation:none!important}}

.royal-home .royal-bottom[hidden],.member-banner[hidden],.schedule-preview[hidden] {display:none!important}
.member-banner {display:grid;grid-template-columns:80px minmax(0,1fr) auto;align-items:center;gap:18px;min-height:112px;margin:16px 0 23px;padding:8px 19px;border:1px solid #ceaa656b;border-radius:14px;background:linear-gradient(90deg,#100a17f2,#120b19c9 60%,#140c1b87),var(--member-banner,url("assets/finitions/apartments.jpg")) center 43%/cover}
.member-banner .welcome-portrait {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  contain:layout paint;
  width:76px;
  height:76px;
}
.member-banner .welcome-portrait > img {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.member-banner .welcome-portrait > .welcome-avatar {object-fit:cover;clip-path:circle(39%)}
.member-banner .welcome-portrait > .welcome-frame {z-index:1;pointer-events:none}
.member-banner .welcome-emblem {object-fit:contain}
.member-banner .welcome-details h2 {margin:2px 0;font:normal clamp(20px,2.4vw,34px)/1.08 Georgia,serif}
.member-banner .welcome-details p {font-size:.85rem}
.member-banner .royal-link {justify-self:end;text-align:center;white-space:nowrap}
.schedule-preview {position:fixed;z-index:85;width:min(360px,calc(100vw - 24px));pointer-events:none;border:1px solid #dcad62;border-radius:13px;overflow:hidden;background:#201327;color:#ffebc0;box-shadow:0 15px 45px #06030cda;animation:schedule-reveal .22s ease-out both}
.schedule-preview-art {height:clamp(108px,25dvh,196px);background:linear-gradient(0deg,#170c1b44,transparent),var(--preview-art) center/cover}
.schedule-preview[data-scene=farm] {--preview-art:url("assets/finitions/farm.jpg")}
.schedule-preview[data-scene=factory] {--preview-art:url("assets/finitions/factory.jpg")}
.schedule-preview[data-scene=event] {--preview-art:url("assets/finitions/event.jpg")}
.schedule-preview[data-scene=farm] .schedule-preview-art:not(.two-activities) {animation:preview-field 8s ease-in-out infinite alternate}
.schedule-preview[data-scene=factory] .schedule-preview-art {animation:preview-forge 4s ease-in-out infinite alternate}
.schedule-preview-art.two-activities {display:grid;grid-template-columns:1fr 1fr;background:none}
.schedule-preview-art.two-activities::before,.schedule-preview-art.two-activities::after {content:"";background-position:center;background-size:cover}
.schedule-preview-art.two-activities::before {background-image:url("assets/finitions/farm.jpg")}
.schedule-preview-art.two-activities::after {background-image:url("assets/finitions/factory.jpg")}
.schedule-preview-copy {padding:10px 14px;display:grid;gap:4px}
.schedule-preview-copy h4 {margin:0;font:700 1.1rem Georgia,serif}
.schedule-preview-copy span {font-size:.76rem;color:#e9c7b7}
.schedule-preview-copy strong {font-size:.85rem}
@keyframes schedule-reveal {from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
@keyframes preview-field {from{background-position:22% center}to{background-position:75% center}}
@keyframes preview-forge {from{filter:brightness(.87)}to{filter:brightness(1.18)}}
@media(max-width:610px){
 .member-banner {grid-template-columns:62px minmax(0,1fr);gap:9px;padding:10px}
 .member-banner .welcome-portrait {width:59px;height:59px}
 .member-banner .royal-link {grid-column:2;justify-self:start;padding:7px 10px;min-height:34px;font-size:.78rem}
 .passport-ornaments{width:clamp(34px,12%,48px)}
}
@media(prefers-reduced-motion:reduce){.schedule-preview,.schedule-preview-art {animation:none!important}}
#popovers .notice-row {padding:6px 9px;margin:4px 0;gap:6px}
#popovers .notice-row :is(p,h3,small) {margin:1px 0;line-height:1.3}
#popovers input[type=file]::file-selector-button {background:#362040;color:#ffe2a7;border:1px solid #b99359;border-radius:7px;padding:6px 9px;margin-inline-end:8px;font:inherit;cursor:pointer}
#popovers .ornament-select {grid-template-columns:repeat(auto-fit,minmax(82px,116px));justify-content:start;gap:7px}
#popovers .ornament-select .shop-art {height:68px;width:100%;object-fit:contain}
.royal-passport .default-sigil {font-size:0;background:url("assets/correction/embleme.png") center/92% no-repeat}

.royal-chest .treasure-art {position:relative;width:86px;height:72px;display:block;filter:drop-shadow(0 3px 7px #000b)}
.treasure-art img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.treasure-open {opacity:0;transform:translateY(3px);transition:opacity .24s,transform .33s}
.treasure-closed {transition:opacity .2s}
.royal-chest.ready:not(.opening-chest) .treasure-art {animation:chest-idle 4s ease-in-out infinite;filter:drop-shadow(0 0 11px #edb4568a)}
.royal-chest.opening-chest .treasure-open {opacity:1;transform:translateY(0)}
.royal-chest.opening-chest .treasure-closed {opacity:0}
.chest-progress {display:inline-flex;align-items:center;gap:5px}
.chest-progress img {width:30px;height:26px;object-fit:contain}
.royal-ritual .treasure-art {width:97px;height:77px}
@media(prefers-reduced-motion:reduce){.royal-chest .treasure-art {animation:none!important}.treasure-art img {transition:none}}



.royal-header .royal-brand .brand-crest {position:static;display:grid;width:clamp(39px,4vw,48px);height:clamp(43px,4.7vw,56px);flex:none}
.schedule-preview {box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:hidden}
.schedule-preview-copy {min-width:0;overflow-wrap:anywhere}
@media(max-height:450px){.schedule-preview-art{height:min(29dvh,105px)}.schedule-preview-copy{padding:6px 10px}}
#popovers .panel {box-sizing:border-box;max-width:calc(100vw - 24px)}
#popovers .panel :is(input,select,textarea) {min-width:0;max-width:100%}
.treasure-art::after {content:"";position:absolute;inset:13% 0 4%;background:radial-gradient(ellipse,#ffe0a97a,transparent 62%);opacity:0;pointer-events:none}
.royal-chest.opening-chest .treasure-art::after {animation:treasure-flash .5s ease-out both}
@keyframes treasure-flash {0%,100%{opacity:0}28%{opacity:1}}
@media(prefers-reduced-motion:reduce){.royal-chest.opening-chest .treasure-art::after{animation:none}}

