/* Profile cabinet and compact GRID selection console. */
dialog.profile-panel{position:fixed;inset:0;margin:auto;width:min(450px,calc(100vw - 34px));max-width:450px;height:min(740px,calc(100dvh - 110px));max-height:none;padding:17px 13px 12px;border:9px solid #535d78;border-radius:20px;background:linear-gradient(125deg,#626779,#292b3c);color:#f4ead6;box-shadow:inset 0 0 0 3px #9299a9,0 0 0 3px #242637,0 18px 70px #000b;overflow:visible;box-sizing:border-box;font-family:inherit}
.profile-panel::backdrop{background:#080c25b8;backdrop-filter:blur(7px)}
.profile-medallion{position:absolute;top:-43px;left:calc(50% - 31px);width:62px;height:62px;display:grid;place-items:center;font-size:39px;border-radius:50%;color:#ffda62;background:radial-gradient(circle at 35% 25%,#e9b735,#815011);border:6px solid #586078;box-shadow:0 0 0 3px #252a3d,inset 0 0 0 3px #f0cf62;text-shadow:0 3px #68400d}
.profile-tabs{display:flex;gap:7px;margin:8px 0 12px;height:52px}.profile-tabs button{flex:1;font:bold 21px Georgia,serif;color:#ded8cd;background:linear-gradient(#494b5d,#303141);border:3px solid #777c91;box-shadow:inset 0 0 0 2px #292b38;border-radius:5px}.profile-tabs button[aria-selected=true]{border-color:#d1ac43;color:#fff4d0;background:linear-gradient(#656273,#353240)}
.profile-scroll{height:calc(100% - 73px);overflow:auto;overscroll-behavior:contain;border:4px solid #282b3a;border-radius:10px;background:linear-gradient(100deg,#55515b,#706969 50%,#514e59);box-shadow:inset 0 0 15px #171923;padding:0;scrollbar-color:#a49267 #33313d}
.profile-scroll h2,.profile-scroll h3{margin:0 0 7px;font-family:Georgia,serif;text-shadow:0 2px 2px #171723}.profile-scroll p{margin:8px 0;font-size:14px}.profile-scroll small{color:#ddd3cf}.profile-section,.profile-identity{padding:20px 17px;border-bottom:3px solid #393641;box-shadow:0 1px #99908a}.profile-identity{display:flex;align-items:center;gap:16px}.profile-identity h2{font-size:24px;overflow-wrap:anywhere}.profile-portrait{flex-shrink:0;width:85px;height:85px;padding:3px!important;border:4px solid #e4c761!important;border-radius:50%!important;background:#282837!important;box-shadow:0 0 12px #a457ed}.profile-portrait img{width:100%;height:100%;object-fit:cover;border-radius:50%}.profile-connection{position:relative;padding:10px 13px;display:flex;align-items:center;justify-content:space-between;background:#36313c;color:#6bc8ff;font-weight:bold;font-size:13px}.profile-gear,.profile-info{border-radius:50%;width:30px;height:30px;padding:0;border:3px solid #81899b;background:linear-gradient(#259de9,#134993);color:white;font-weight:bold;font-size:20px}.profile-account-menu{position:absolute;right:8px;top:44px;z-index:5;background:#272735;padding:10px;border:2px solid #958569;box-shadow:0 5px 15px #0008}.profile-account-menu[hidden]{display:none}.profile-account-menu button{background:#8c2929;color:white;border:2px solid #d09268;padding:8px 24px}.profile-section-heading{display:flex;justify-content:space-between;align-items:center}.profile-tip{position:relative}.profile-tooltip{display:none;position:absolute;right:0;bottom:36px;width:230px;background:#e4ebf0;color:#1f2b3a;font-size:13px;padding:12px;border:2px solid #7d9bb1;border-radius:8px;z-index:10;box-shadow:0 5px 15px #0007}.profile-tip:hover .profile-tooltip,.profile-tip:focus-within .profile-tooltip,.profile-tip.open .profile-tooltip{display:block}.profile-section progress{width:100%;height:22px;accent-color:#309de9}.profile-guild{display:flex;gap:18px;align-items:center}.profile-guild-banner{font-size:48px;color:#e9c564}.profile-rank{text-align:center}.profile-army{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.profile-army>div{position:relative;background:linear-gradient(#555e78,#242938);border:3px solid #798196;border-radius:7px;overflow:hidden;display:flex;flex-direction:column}.profile-army .leader{grid-row:span 2}.profile-army img{width:100%;min-height:0;object-fit:contain;flex:1}.profile-army b{font-size:11px;background:#673d85;padding:2px}.profile-army small{font-size:9px;padding:3px;overflow-wrap:anywhere;text-align:center}.profile-avatar-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;padding:15px}.profile-avatar-grid button{background:none;border:0;color:white;padding:0}.profile-avatar-grid img{width:75px;max-width:100%;aspect-ratio:1;border-radius:50%;border:4px solid #322d29;object-fit:cover}.profile-avatar-grid button[aria-pressed=true] img{border-color:#f5d66a;box-shadow:0 0 10px #ffcf57}.profile-avatar-grid small{display:block}.profile-scroll>h2{padding:15px;text-align:center}.profile-scroll>.audio-controls{padding:20px 14px}.profile-scroll .audio-controls label{display:grid;grid-template-columns:1fr 35px;gap:15px;margin:24px 0;font-weight:bold}.profile-scroll .audio-controls input[type=range]{grid-column:1;width:100%;accent-color:#3297f3}.profile-scroll .audio-controls input[type=checkbox]{width:26px;height:26px;accent-color:#36a5e9}.profile-quality{display:flex;justify-content:space-between;padding:20px}.profile-panel>.popup-close{position:absolute!important;top:auto!important;right:calc(50% - 27px)!important;bottom:-69px;width:54px;height:54px;padding:0;border-radius:50%;border:5px solid #697073;background:radial-gradient(circle at 35% 25%,#f0644c,#a51b17);box-shadow:0 0 0 3px #292c34;color:#fff7db;font:bold 38px Arial;line-height:40px;z-index:3}.profile-error{color:#ffcf95;padding:10px}
.mode-online #lobby-panel .grid-console{position:relative}.mode-online #lobby-panel .grid-console .market-moves{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:12px}.mode-online #lobby-panel .grid-console .market-moves button{min-width:0;flex:1;padding:9px 6px;border:3px solid #b0a384;border-radius:7px;background:linear-gradient(#e8bc38,#946419);font-weight:bold;color:#fff5d2;white-space:nowrap}.mode-online #lobby-panel .grid-console .market-moves .grid-info{background:linear-gradient(#329ced,#174b95)}.mode-online #lobby-panel .grid-console .grid-selection-close{position:absolute;right:5px;top:3px;background:none;border:0;color:#eee;font-size:24px;padding:0 5px}.mode-online #lobby-panel .market-slot.purchase-clear{box-shadow:0 0 0 4px #ab3931,inset 0 0 17px #be3128}.mode-online #lobby-panel .market-slot.selected{box-shadow:0 0 0 5px #f0c744,0 0 15px #f5bd4c;border-color:#ffd858;z-index:2}.shop-unit-detail{position:fixed;inset:0;margin:auto;width:min(460px,calc(100vw - 32px));max-height:85dvh;overflow:auto;padding:24px;border:5px solid #878492;border-radius:12px;background:linear-gradient(120deg,#353746,#655b60);color:#fff4df}.shop-unit-detail::backdrop{background:#0b1029ba;backdrop-filter:blur(4px)}.shop-unit-detail progress{width:100%;accent-color:#b361e4}.shop-unit-detail .detail-close{float:right}.shop-unit-detail .unit-traits{display:flex;gap:8px}.shop-unit-detail img{max-width:48px}
@media(max-width:500px){dialog.profile-panel{width:calc(100vw - 24px);height:calc(100dvh - 120px);padding:12px 7px;border-width:6px}.profile-tabs{height:46px}.profile-tabs button{font-size:19px}.profile-section,.profile-identity{padding:17px 12px}.profile-identity h2{font-size:21px}.profile-portrait{width:74px;height:74px}.profile-scroll{height:calc(100% - 66px)}.profile-panel>.popup-close{bottom:-65px}.profile-tooltip{width:205px}.mode-online #lobby-panel .grid-console .market-moves button{font-size:12px}}

.profile-scroll{overflow-x:hidden}.profile-army>div{min-width:0}.profile-army img{display:block;max-height:110px}.profile-army .leader img{max-height:240px}

#home-profile .account-header-avatar{width:30px;height:30px;object-fit:cover;border-radius:50%;border:2px solid #cdb267;vertical-align:middle;margin-right:7px}.profile-panel.menu-popup h2{margin:0 0 7px}.profile-panel .profile-scroll>h2{margin:0;padding:15px}.profile-panel .profile-scroll>button{margin:10px 15px}

.guild-dialog{width:min(430px,calc(100vw - 26px));max-height:80dvh;overflow:auto;background:linear-gradient(120deg,#555562,#373844);border:8px solid #707991;border-radius:19px;color:#fff1cd;padding:16px;box-shadow:0 0 0 3px #282e40,0 20px 60px #0009}.guild-dialog::backdrop{background:#101329b0;backdrop-filter:blur(5px)}.guild-dialog header{display:flex;align-items:center;gap:10px;border-bottom:3px solid #b79745}.guild-dialog h2{flex:1;font:23px Georgia}.guild-dialog button,.guild-open{border:2px solid #bda565;border-radius:8px;background:linear-gradient(#368fc1,#205271);color:#fff4d5;padding:9px 12px;font-weight:bold}.guild-dialog .guild-close{float:right;background:#a52a23}.guild-list-heading{display:flex;align-items:center;justify-content:space-between;margin:15px 0}.guild-members{display:grid;gap:7px}.guild-dialog .guild-member{display:flex;align-items:center;gap:10px;text-align:left;background:linear-gradient(#527f7b,#254d54);border-color:#b09861}.guild-member>span:first-of-type{flex:1}.guild-member small{display:block;text-transform:capitalize;font-weight:normal}.guild-avatar{width:42px;height:42px;border:3px solid #c2a759;border-radius:50%;object-fit:cover;flex-shrink:0}.chat-bubble>.guild-avatar{float:left;margin:0 10px 8px 0}.guild-body label{display:grid;gap:5px;margin:15px 0}.guild-body input,.guild-body select{padding:10px;background:#252632;color:white;border:2px solid #938779;border-radius:6px;min-width:0}.guild-open{font-size:23px;display:block;width:100%;text-align:left}
.guild-dialog{box-sizing:border-box;overflow-x:hidden}.guild-dialog>header{position:static;inset:auto;transform:none;width:auto;height:auto;min-height:55px;padding:0;margin:0 0 16px;background:none;box-shadow:none;z-index:auto;justify-content:space-between}.guild-dialog>header h2{margin:0;min-width:0;overflow-wrap:anywhere}.guild-dialog>header button{flex-shrink:0}.guild-dialog .guild-close{position:static;float:none;display:block;margin:0 0 8px auto}.guild-dialog .guild-body{clear:both}.guild-dialog .guild-member>span{min-width:0}.guild-dialog .guild-member strong{overflow-wrap:anywhere}

.mode-online #home-profile{position:relative;overflow:visible!important;padding-left:57px!important;border-color:var(--collection-color,#b89d65)!important;min-width:130px}.mode-online #home-profile:before{display:none!important}.mode-online #home-profile .account-header-avatar{position:absolute;left:-8px;top:50%;transform:translateY(-50%);width:52px;height:52px;border:4px ridge var(--collection-color,#b89d65);border-radius:38%;box-shadow:0 0 8px var(--collection-color,#b89d65);object-fit:cover}.mode-online #home-profile:after,.profile-portrait:after{content:attr(data-collection-level);position:absolute;left:6px;bottom:-12px;min-width:23px;padding:2px;color:white;font-weight:900;font-size:13px;line-height:18px;background:linear-gradient(#506f89,#172331);border:2px solid var(--collection-color,#b89d65);border-radius:45%;text-align:center;text-shadow:0 2px #000}.profile-portrait{position:relative;border:4px ridge var(--collection-color,#b89d65)!important;box-shadow:0 0 12px var(--collection-color,#b89d65)}.profile-portrait:after{left:25px;bottom:-10px}.tome-open{display:block;margin:12px auto;background:linear-gradient(#796298,#393055)!important}.tome-spread{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:10px;background:#523622;border:6px ridge #ae8a4e;border-radius:8px;box-shadow:0 8px 20px #0009}.tome-spread .tome-page{display:flex;flex-direction:column;align-items:center;gap:12px;min-width:0;padding:12px 5px;background:linear-gradient(100deg,#dfc38e,#f7e8b9,#cdb07c);color:#382516;text-shadow:none;border:0;min-height:260px}.tome-page img{width:100%;max-height:155px;object-fit:contain}.tome-page b{color:#6e2b9d}.tome-view{text-align:center}@media(max-width:650px){.mode-online #home-profile{padding-left:43px!important;min-width:95px}.mode-online #home-profile .account-header-avatar{width:39px;height:39px;left:-5px}.mode-online #home-profile:after{left:3px;bottom:-9px;font-size:10px;line-height:12px;min-width:18px}}
.market-slot{overflow:visible}.grid-burst{pointer-events:none;position:absolute;inset:-15%;z-index:5;background:radial-gradient(circle,#fffbdc 0 7%,#ffd351 12%,#ef791999 27%,transparent 65%);animation:grid-burst .45s ease-out both}.grid-destroying{animation:grid-break .45s ease-in both!important}@keyframes grid-burst{from{transform:scale(.1);opacity:1}to{transform:scale(1.8);opacity:0}}@keyframes grid-break{0%{filter:brightness(1);transform:scale(1)}30%{filter:brightness(3);transform:scale(1.08)}100%{filter:brightness(.3);transform:scale(.3) rotate(8deg);opacity:0}}@media(prefers-reduced-motion:reduce){.grid-burst,.grid-destroying{animation:none!important}}
