.app-boot{
  position:fixed;
  inset:0;
  z-index:2000;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 42%,#315b4138,transparent 30%),
    linear-gradient(135deg,#020906,#0b1d14 55%,#06110c);
  color:#f8f1df;
}
.app-boot[aria-hidden="true"]{display:none}
.app-boot-card{text-align:center}
.app-boot-card .eyebrow{color:#d8bd6f}
.app-boot-card h1{margin:7px 0 22px;font:700 clamp(2.4rem,7vw,4.5rem)/1 Georgia,serif}
.app-boot-card>p:last-child{margin:17px 0 0;color:#c7d0c9;font-size:.78rem;font-weight:900;letter-spacing:.09em}
.app-boot-rune{position:relative;display:block;width:58px;height:58px;margin:auto;border:1px solid #d8bd6f55;border-radius:50%;box-shadow:0 0 30px #d8bd6f1c}
.app-boot-rune:before,.app-boot-rune:after,.app-boot-rune i{content:"";position:absolute;inset:9px;border:2px solid transparent;border-top-color:#e2c976;border-radius:50%;animation:app-boot-turn 1.1s linear infinite}
.app-boot-rune:after{inset:18px;border-top-color:#6ab985;animation-direction:reverse;animation-duration:.8s}
.app-boot-rune i{inset:25px;border:0;background:#e2c976;box-shadow:0 0 14px #e2c976}
@keyframes app-boot-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.app-boot-rune:before,.app-boot-rune:after{animation:none}.app-boot-rune:after{transform:rotate(180deg)}}

.auth-gate{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  overflow:auto;
  padding:24px;
  background:
    linear-gradient(135deg,#04100bd9,#10281ddd),
    url("../../assets/locations/ostoja-pierwszych.webp") center/cover no-repeat;
  color:#f8f1df;
}
.auth-gate[aria-hidden="true"]{display:none}
.auth-shell{
  width:min(940px,100%);
  display:grid;
  grid-template-columns:minmax(240px,.9fr) minmax(320px,1.1fr);
  overflow:hidden;
  border:1px solid #d8be7077;
  border-radius:28px;
  background:#07140ef2;
  box-shadow:0 30px 100px #000c;
  backdrop-filter:blur(12px);
}
.auth-story{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:560px;
  padding:40px;
  background:
    linear-gradient(180deg,#081a12aa,#081a12f5),
    url("../../assets/world/forest-explorer.webp") center/cover no-repeat;
}
.auth-story .eyebrow{color:#d8bd6f}
.auth-story h1{margin:8px 0 14px;font:700 clamp(2.2rem,5vw,4rem)/.95 Georgia,serif}
.auth-story p{max-width:390px;color:#d2d8ce;line-height:1.6}
.auth-version{color:#d8bd6f;font-size:.75rem;font-weight:900;letter-spacing:.13em}
.auth-panel{padding:34px}
.auth-panel h2{margin:0 0 7px;font:700 1.7rem Georgia,serif}
.auth-panel-copy{margin:0 0 20px;color:#aebbb2}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:20px;padding:5px;border-radius:14px;background:#ffffff0d}
.auth-tab{
  border:0;
  border-radius:10px;
  padding:11px;
  background:transparent;
  color:#b9c3bc;
  font-weight:900;
  cursor:pointer;
}
.auth-tab.active{background:#d7bc6d;color:#132118}
.auth-form{display:grid;gap:14px}
.auth-form[hidden]{display:none}
.auth-field{display:grid;gap:6px}
.auth-field span{color:#dfe5df;font-size:.78rem;font-weight:900}
.auth-field input{
  width:100%;
  border:1px solid #72827677;
  border-radius:11px;
  padding:12px 13px;
  background:#ffffff0b;
  color:#fffaf0;
  font:inherit;
  outline:none;
}
.auth-field textarea{
  width:100%;
  resize:vertical;
  border:1px solid #72827677;
  border-radius:11px;
  padding:12px 13px;
  background:#ffffff0b;
  color:#fffaf0;
  font:inherit;
  line-height:1.45;
  outline:none;
}
.auth-field textarea:focus{border-color:#d8bd6f;box-shadow:0 0 0 3px #d8bd6f1f}
.auth-field input:focus{border-color:#d8bd6f;box-shadow:0 0 0 3px #d8bd6f1f}
.auth-field small{color:#8fa096;font-size:.7rem;line-height:1.35}
.auth-submit{
  margin-top:4px;
  border:1px solid #e5cd84;
  border-radius:12px;
  padding:13px 18px;
  background:linear-gradient(#d9bf72,#b99342);
  color:#142017;
  font-weight:1000;
  cursor:pointer;
}
.auth-submit:disabled{opacity:.55;cursor:wait}
.auth-message{
  min-height:22px;
  margin:14px 0 0;
  color:#e7cf86;
  font-size:.8rem;
  font-weight:800;
  line-height:1.4;
}
.auth-message.error{color:#ff9e94}
.auth-server-state{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0 0 15px;
  color:#95a59b;
  font-size:.72rem;
}
.auth-server-state:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d5a443;
  box-shadow:0 0 10px #d5a443;
}
.auth-server-state.online:before{background:#58bd72;box-shadow:0 0 10px #58bd72}
.auth-server-state.offline:before{background:#d65a51;box-shadow:0 0 10px #d65a51}
.auth-local{
  display:none;
  width:100%;
  margin-top:10px;
  border:1px solid #77867b;
  border-radius:11px;
  padding:11px;
  background:#ffffff0b;
  color:#dce4dd;
  font-weight:900;
  cursor:pointer;
}
.auth-local.show{display:block}
.progress-import{margin-top:12px;padding:15px;border:1px solid #d8bd6f66;border-radius:14px;background:#d8bd6f0d}
.progress-import[hidden]{display:none}
.progress-import h3{margin:0 0 7px;font:700 1rem Georgia,serif}
.progress-import p{margin:0;color:#b9c4bc;font-size:.76rem;line-height:1.45}
.progress-import>div{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.progress-import button{border:1px solid #a99560;border-radius:9px;padding:9px;background:#17271f;color:#fff7df;font-size:.7rem;font-weight:900;cursor:pointer}
.progress-import button:first-child{background:#c2a657;color:#142017}
.account-widget{
  position:fixed;
  z-index:100;
  left:18px;
  top:14px;
  width:62px;
  color:#f4ecd7
}
.account-widget[hidden]{display:none}
.account-profile-button{position:relative;display:grid;place-items:center;width:62px;padding:5px 4px 4px;border:1px solid #b9aa7f77;border-radius:18px;background:linear-gradient(145deg,#10241af5,#07130df5);box-shadow:0 10px 30px #000a;color:#f4ecd7;cursor:pointer;backdrop-filter:blur(6px)}
.account-profile-button[hidden]{display:none}
.account-profile-button:hover{border-color:#e3c774;transform:translateY(-1px);box-shadow:0 12px 34px #000b,0 0 18px #d4b85c2b}
.account-profile-button:focus-visible{outline:2px solid #fff;outline-offset:3px}
.account-avatar{position:relative;width:48px;height:48px;overflow:visible;border:2px solid #d7bd6e;border-radius:50%;background:radial-gradient(circle at 50% 25%,#4c6c54,#13251b 68%);box-shadow:0 0 0 3px #d7bd6e18}
.account-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;object-position:50% 13%}
.account-avatar i{position:absolute;right:-5px;bottom:-3px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 2px;border:1px solid #d7bd6e;border-radius:50%;background:#11231a;font:normal .7rem/1 sans-serif}
.account-avatar i:empty{display:none}
.account-profile-caption{margin-top:4px;color:#ead99f;font-size:.56rem;font-weight:1000;text-transform:uppercase;letter-spacing:.08em}
.account-sync-dot{position:absolute;right:5px;top:5px;width:9px;height:9px;border:2px solid #0b1812;border-radius:50%;background:#d5a443;box-shadow:0 0 8px #d5a443}
.account-sync-dot[data-state="saved"],.account-sync-dot[data-state="ready"]{background:#58bd72;box-shadow:0 0 8px #58bd72}
.account-sync-dot[data-state="retry"],.account-sync-dot[data-state="conflict"]{background:#d65a51;box-shadow:0 0 8px #d65a51}
.account-local-login{width:72px;border:1px solid #a79461;border-radius:11px;padding:9px 8px;background:#102018ef;color:#fff7df;font-size:.66rem;font-weight:900;cursor:pointer;box-shadow:0 8px 24px #0009}
.account-local-login[hidden]{display:none}
body[data-active-view="battle"] .account-widget{display:none!important}
#account-save-state[data-state="saved"]{color:#75ce89}
#account-save-state[data-state="ready"]{color:#75ce89}
#account-save-state[data-state="saving"],#account-save-state[data-state="loading"]{color:#e7cf86}
#account-save-state[data-state="retry"]{color:#e7b86f}
#account-save-state[data-state="conflict"]{color:#ff9187}
#account-creature-registry-state[data-state="saved"]{color:#75ce89}
#account-creature-registry-state[data-state="loading"],#account-creature-registry-state[data-state="waiting"]{color:#e7cf86}
#account-creature-registry-state[data-state="retry"]{color:#e7b86f}
.account-action{
  flex:none;
  border:1px solid #a79461;
  border-radius:9px;
  padding:7px 9px;
  background:#17271f;
  color:#fff7df;
  font-size:.68rem;
  font-weight:900;
  cursor:pointer;
}
.profile-overlay{
  position:fixed;
  inset:0;
  z-index:1100;
  display:grid;
  place-items:center;
  padding:14px;
  background:radial-gradient(circle at 25% 30%,#1c3c2b88,transparent 38%),#020805ed;
  color:#f8f1df;
  backdrop-filter:blur(12px);
}
.profile-overlay[aria-hidden="true"]{display:none}
.profile-panel{
  position:relative;
  display:grid;
  grid-template-columns:minmax(280px,.76fr) minmax(0,1.24fr);
  width:min(1180px,calc(100vw - 28px));
  height:min(820px,calc(100vh - 28px));
  min-height:0;
  overflow:hidden;
  border:1px solid #d8be7077;
  border-radius:28px;
  background:#0a1912;
  box-shadow:0 32px 110px #000e,0 0 0 1px #ffffff08 inset;
}
.profile-showcase{position:relative;display:flex;flex-direction:column;min-width:0;overflow:hidden;padding:28px 28px 22px;background:linear-gradient(180deg,#06120b1f,#06120bd9),url("../../assets/locations/ostoja-pierwszych.webp") center/cover no-repeat}
.profile-showcase:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 75%,#0a1912),linear-gradient(0deg,#06110bd9,transparent 35%);box-shadow:inset 0 0 75px #020805b8}
.profile-showcase-head{position:relative;z-index:3}.profile-showcase-head strong{display:block;max-width:280px;color:#eee5cb;font:700 1.05rem/1.35 Georgia,serif}
.profile-preview{--profile-primary:#284f39;--profile-accent:#d4bd70;position:relative;z-index:2;flex:1;min-height:0;margin:4px -18px 0}
.profile-preview-aura{position:absolute;left:50%;bottom:7%;width:78%;aspect-ratio:1;transform:translateX(-50%);border-radius:50%;background:radial-gradient(circle,var(--profile-accent) 0,transparent 66%);filter:blur(35px);opacity:.26}
#profile-preview-avatar{position:absolute;left:50%;bottom:-1%;width:100%;height:106%;transform:translateX(-50%);object-fit:contain;filter:drop-shadow(0 18px 16px #000b)}
#profile-preview-accessory{position:absolute;z-index:3;right:11%;bottom:12%;display:grid;place-items:center;width:46px;height:46px;border:2px solid var(--profile-accent);border-radius:50%;background:#102018e8;box-shadow:0 7px 18px #0009;font:normal 1.45rem/1 sans-serif}
#profile-preview-accessory:empty{display:none}
.profile-preview-identity{position:relative;z-index:3;padding:14px 17px;border:1px solid #d8be704d;border-radius:15px;background:#07130de8;box-shadow:0 10px 30px #0008;backdrop-filter:blur(7px)}
.profile-preview-identity span,.profile-preview-identity small{display:block;color:#baac85;font-size:.64rem;font-weight:900;text-transform:uppercase;letter-spacing:.1em}
.profile-preview-identity strong{display:block;margin:4px 0 3px;color:#fff7df;font:700 1.4rem Georgia,serif}
.profile-preview-identity small{color:#d5be71;font-size:.58rem}
.profile-editor{position:relative;display:flex;flex-direction:column;min-width:0;overflow-y:auto;padding:30px 34px 24px;background:radial-gradient(circle at 100% 0,#2b4f3933,transparent 32%),linear-gradient(145deg,#0a1912,#10231a)}
.profile-close{position:absolute;z-index:4;right:17px;top:13px;width:38px;height:38px;border:1px solid #8d836777;border-radius:50%;background:#08150f;color:#e7d8ad;font-size:1.55rem;line-height:1;cursor:pointer}
.profile-heading{margin:0 45px 19px 0}
.profile-heading h2{margin:3px 0 5px;font:700 clamp(1.7rem,3vw,2.35rem) Georgia,serif}
.profile-heading>p:last-child{margin:0;color:#aebbb2;font-size:.77rem;line-height:1.45}
.profile-fields{display:grid;grid-template-columns:.9fr 1.1fr;gap:13px;margin-bottom:14px}
.profile-choice{min-width:0;margin:10px 0 0;padding:0;border:0}
.profile-choice legend{margin-bottom:7px;color:#d8cda9;font-size:.68rem;font-weight:1000;text-transform:uppercase;letter-spacing:.1em}
.profile-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.profile-options label{cursor:pointer}
.profile-options input{position:absolute;opacity:0;pointer-events:none}
.profile-options span{display:grid;place-items:center;min-height:62px;padding:7px;border:1px solid #70817655;border-radius:12px;background:#ffffff08;font-size:1.35rem;transition:.18s}
.profile-options b{margin-top:4px;color:#d8dfda;font-size:.6rem}
.profile-options input:checked+span{border-color:#e0c66f;background:#d7bc6d1c;box-shadow:inset 0 0 18px #d7bc6d12,0 0 0 2px #d7bc6d22}
.profile-options input:focus-visible+span{outline:2px solid #fff;outline-offset:2px}
.profile-avatar-options span{position:relative;display:flex;min-height:142px;overflow:hidden;align-items:center;justify-content:flex-end;flex-direction:column;padding:0 5px 8px;background:linear-gradient(180deg,#14271e,#0b1812)}
.profile-avatar-options span:after{content:"";position:absolute;z-index:1;inset:auto 0 0;height:47%;background:linear-gradient(transparent,#07130df5)}
.profile-avatar-options img{position:absolute;left:50%;top:-7px;width:104%;height:125px;transform:translateX(-50%);object-fit:contain;filter:drop-shadow(0 7px 5px #0009)}
.profile-avatar-options b,.profile-avatar-options small{position:relative;z-index:2;display:block;text-align:center}.profile-avatar-options b{margin-top:auto;font-size:.67rem}.profile-avatar-options small{color:#aebbb2;font-size:.5rem;line-height:1.2}
.profile-lower-choices{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.profile-swatch i{display:block;width:24px;height:24px;border:4px solid #d4bd70;border-radius:50%;background:#284f39}
.profile-swatch.ember i{border-color:#f0a24b;background:#7a2e25}
.profile-swatch.river i{border-color:#77cee0;background:#15536c}
.profile-swatch.storm i{border-color:#b9aeff;background:#403d6f}
.profile-account{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;padding:12px 14px;border:1px solid #d8be7040;border-radius:14px;background:#06130deb}
.profile-account-actions{display:flex;gap:7px}
.profile-account>div{min-width:0}.profile-account span,.profile-account strong,.profile-account small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-account span{color:#d8cda9;font-size:.58rem;font-weight:1000;text-transform:uppercase;letter-spacing:.1em}.profile-account strong{margin-top:4px;color:#fff7df;font-size:.78rem}.profile-account small{margin-top:3px;color:#9eada3;font-size:.63rem}
.profile-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:auto;padding-top:16px;border-top:1px solid #ffffff12}
.profile-footer p{margin:0;color:#8bd39a;font-size:.76rem;font-weight:800}
.profile-footer p.error{color:#ff9e94}
.profile-footer>div{display:flex;gap:8px;margin-left:auto}
.profile-footer button{border:1px solid #887d60;border-radius:10px;padding:10px 16px;background:#17271f;color:#fff7df;font-weight:900;cursor:pointer}
#profile-save{border-color:#e5cd84;background:linear-gradient(#d9bf72,#b99342);color:#142017}
#profile-save:disabled{opacity:.55;cursor:wait}
.save-recovery-overlay{position:fixed;inset:0;z-index:2200;display:grid;place-items:center;padding:18px;background:#020805e8;color:#f8f1df;backdrop-filter:blur(10px)}
.save-recovery-overlay[aria-hidden="true"]{display:none}
.save-recovery-panel{width:min(560px,100%);padding:30px;border:1px solid #d8be7077;border-radius:24px;background:linear-gradient(145deg,#0a1912,#10231a);box-shadow:0 30px 100px #000d}
.save-recovery-panel h2{margin:6px 0 10px;font:700 1.8rem Georgia,serif}.save-recovery-panel>p:not(.eyebrow){color:#b8c3bb;line-height:1.55}
.save-recovery-actions{display:grid;gap:9px;margin-top:22px}.save-recovery-actions button{border:1px solid #a79461;border-radius:11px;padding:12px;background:#17271f;color:#fff7df;font-weight:900;cursor:pointer}.save-recovery-actions button:nth-child(2){border-color:#e5cd84;background:linear-gradient(#d9bf72,#b99342);color:#142017}
@media(max-width:760px){
  .auth-gate{padding:10px}
  .auth-shell{grid-template-columns:1fr}
  .auth-story{min-height:190px;padding:25px;background-position:center 35%}
  .auth-story p{display:none}
  .auth-panel{padding:24px}
  .account-widget{left:8px;top:8px;width:58px}
  .account-profile-button{width:58px}.account-avatar{width:44px;height:44px}
  .profile-overlay{display:block;overflow:auto;padding:0}
  .profile-panel{display:block;width:100%;height:auto;min-height:100vh;border:0;border-radius:0}
  .profile-showcase{height:430px;padding:22px 18px}
  .profile-showcase:after{background:linear-gradient(0deg,#06110bed,transparent 42%)}
  .profile-preview{height:310px;margin:-5px 0 0}
  .profile-preview-identity{position:absolute;left:16px;right:16px;bottom:15px}
  .profile-editor{overflow:visible;padding:26px 16px}
  .profile-heading{margin-right:42px}
  .profile-fields{grid-template-columns:1fr}
  .profile-options{grid-template-columns:repeat(2,1fr)}
  .profile-avatar-options span{min-height:180px}.profile-avatar-options img{height:165px}
  .profile-lower-choices{grid-template-columns:1fr}
  .profile-lower-choices .profile-options{grid-template-columns:repeat(4,1fr)}
  .profile-footer{align-items:stretch;flex-direction:column}
  .profile-account{align-items:stretch;flex-direction:column}.profile-account-actions{display:grid}.profile-account .account-action{width:100%}
  .profile-footer>div{margin-left:0}
  .profile-footer button{flex:1}
}
