/* Game-reference detail panel, original glyph shapes and grade colors. */
:root{--grade-s:#f78a49;--grade-a:#da79d4;--grade-b:#81a0cf;--grade-c:#a8cbb3}
.game-hero-dialog{width:min(1280px,98vw);max-height:96dvh;padding:16px 12px;background:radial-gradient(ellipse at 65% 10%,#555a59 0,#343837 34%,#252727 80%);border:3px ridge #978a6b;overflow-y:auto;overflow-x:hidden}
.game-hero-dialog .dialog-title{padding:0 12px 10px;margin-bottom:12px}.game-hero-dialog .dialog-title h2{font-size:26px}
.game-detail-layout{display:grid;grid-template-columns:28px minmax(160px,235px) minmax(0,1fr) 28px;gap:10px;align-items:start;min-width:0}
.game-detail-portrait{min-width:0;position:sticky;top:0}.game-detail-portrait .detail-art{width:100%;aspect-ratio:222/333;position:relative;overflow:hidden;border:2px ridge #b99758;background:#24241c}
.game-detail-portrait .detail-art>img:not(.rank-strip){width:100%;height:100%;object-fit:contain}.game-detail-portrait .detail-art .art-window>img{width:var(--art-width);height:var(--art-height);left:var(--art-left);top:var(--art-top);max-width:none;max-height:none;object-fit:fill}
.game-detail-portrait .portrait-settings{display:grid;gap:8px;padding-top:10px;font-size:16px}.game-detail-portrait .portrait-rank,.portrait-level{display:grid;grid-template-columns:44px minmax(0,1fr);gap:6px;align-items:center;margin:0;min-width:0}
.game-detail-portrait .portrait-rank select{width:100%;min-width:0!important;height:38px;font-size:16px;margin:0;padding:3px 6px}
.level-stepper{display:flex;min-width:0;height:42px;background:#1d211e;border:1px solid #8c8060;border-radius:3px;overflow:hidden}.level-stepper input{min-width:0;width:100%;border:0;background:transparent;padding:4px 8px;color:#eee3c9;font:inherit;appearance:textfield;-moz-appearance:textfield}.level-stepper input::-webkit-inner-spin-button,.level-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.level-step-buttons{display:grid;grid-template-rows:1fr 1fr;width:34px;flex:0 0 34px}.level-step-buttons button{border:0;border-left:1px solid #8c8060;border-radius:0!important;min-height:0;height:20px;line-height:1;padding:1px;background:linear-gradient(#635e4c,#383a30);color:#f1d896;font-size:12px;cursor:pointer}.level-step-buttons button+button{border-top:1px solid #8c8060}.level-step-buttons button:disabled{opacity:.4;cursor:default}
.game-detail-portrait .bonus-check{display:flex;align-items:center;gap:8px;margin:0;padding:7px 8px;min-height:36px;font-size:15px;background:#37392f;border:1px solid #8b7b53;border-radius:3px}.game-detail-portrait .bonus-check input{margin:0}.portrait-extra{display:grid;grid-template-columns:1fr 1fr;gap:6px}.portrait-extra button,.detail-replace{min-width:0;min-height:36px;font-size:15px;padding:4px}
.game-detail-panel{display:grid;grid-template-columns:minmax(0,1fr) 66px;gap:10px;min-width:0;align-items:start}.game-detail-information{min-width:0;background:linear-gradient(90deg,#242727a0,#222725ba);padding:12px 10px;border-block:2px solid #56554d;box-shadow:inset 0 2px 8px #17191870}
.game-aptitudes h3{font-size:21px;font-weight:700;color:#d5bd77;letter-spacing:.06em;margin:0 0 8px}.game-aptitude-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin-bottom:16px}.game-aptitude{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;white-space:nowrap;padding:6px 3px;border:2px ridge #7d8178;border-radius:2px;background:linear-gradient(#626b74,#414c5a);color:var(--apt-color);font-size:18px;line-height:1.3;text-shadow:1px 2px #161b26;box-shadow:inset 0 0 0 1px #c1cbd42e}.game-aptitude.grade-S{background:linear-gradient(#6f6255,#514538)}.game-aptitude.grade-A{background:linear-gradient(#6b5e74,#4a3e57)}.game-aptitude.grade-C{background:linear-gradient(#586f60,#384f44)}.game-aptitude b{font-size:24px;font-weight:600}.game-aptitude game-glyph{width:23px;height:25px;flex:0 0 23px}
game-glyph{display:inline-block;vertical-align:middle;flex:0 0 27px;width:27px;height:29px}game-glyph canvas{width:100%;height:100%;display:block;object-fit:contain}
.game-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;padding:8px 0 18px;border-bottom:2px solid #595850;margin-bottom:16px}.game-stat{display:flex;align-items:center;gap:7px;min-width:0;padding:5px 3px;background:linear-gradient(90deg,#1e2221,#23262480);border-bottom:1px solid #595b51;font-size:20px;white-space:nowrap}.game-stat-label{color:#d8bd76;font-weight:600;letter-spacing:.12em}.game-stat strong{color:#ebe4d5;font-size:23px;font-weight:700;font-variant-numeric:tabular-nums;margin-left:auto}.game-stat-growth{color:#8cc59c;font-size:20px;font-weight:600;letter-spacing:0}
.game-skill-list{display:grid;gap:5px}.game-skill{padding:9px 0;border-bottom:1px solid #6a6250;background:linear-gradient(100deg,#1d2120,#2d292780)}.game-skill-heading{display:grid;grid-template-columns:35px minmax(0,1fr) auto 44px;align-items:center;gap:7px}.game-skill-heading .grade{width:33px;height:33px;line-height:29px;text-align:center;margin:0;border:2px ridge #a49375;border-radius:50%;font-size:25px;color:#e6dcc4;box-shadow:1px 2px 3px #101311}.game-skill-heading strong{font-size:20px;line-height:1.4;color:#e7dfca;font-weight:600;background:linear-gradient(90deg,#49586caa,transparent);padding:1px 3px;min-width:0}.game-skill-type{font-size:17px;color:#bdb6a9}.game-skill-heading .ghost{font-size:16px;padding:2px;min-height:32px;min-width:0;color:#e5dcc7;border-bottom:1px solid #b8a88a;border-radius:0!important}.game-skill p{margin:6px 8px 3px 43px;font-size:16px;line-height:1.55;color:#cfc5b4;overflow-wrap:anywhere}.game-skill p .skill-change{float:right;font-size:14px;padding:2px 7px;min-height:28px}.game-skill-empty{display:flex;align-items:center;gap:10px;min-height:72px;color:#b3ab94;padding:12px 8px;font-size:17px;background:#1c201d77;border:1px solid #655d49;margin:0}.game-skill-empty .grade{flex:0 0 30px;text-align:center}
.game-detail-tabs{display:grid;grid-template-rows:repeat(5,1fr);gap:0}.game-detail-tab{position:relative;display:block;aspect-ratio:73/138;width:100%;padding:0;border:0!important;box-shadow:none!important;background:none;color:#bfb6a5;cursor:pointer;clip-path:polygon(0 0,100% 0,100% 83%,30% 100%,0 100%);border-radius:0!important}.detail-tab-art{display:block;width:100%;height:100%;filter:saturate(.55) brightness(.82)}.game-detail-tab.active .detail-tab-art{filter:saturate(1.3) brightness(1.25);}.game-detail-tab>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.game-detail-tab:hover .detail-tab-art{filter:brightness(1.35)}
.detail-nav{position:sticky;top:45%;align-self:start;margin-top:220px;padding:4px 0;min-width:0;width:28px;height:70px;min-height:44px;color:#d0af67;text-shadow:1px 2px #1b1b16;background:linear-gradient(90deg,transparent,#66512b55,transparent);border:0;border-radius:0!important;font-size:28px;cursor:pointer}.detail-nav:disabled{opacity:.2;cursor:default}.game-hero-dialog .candidate-actions{padding:10px;margin-top:10px}
.game-detail-information .bonus-total,.game-detail-information .bonus-breakdown{margin:10px 0}.allocation-summary{padding:9px 6px;font-size:17px;background:#252d23;color:#dfd4b1}.allocation-summary strong{color:#a5dba2}.game-detail-information .attr-grid{grid-template-columns:76px minmax(64px,1fr) 34px 48px 34px;gap:6px;font-size:16px;margin:5px 0}.game-detail-information .attr-grid>span:first-child{display:flex;gap:5px;align-items:center;color:#d9be7a}.game-detail-information .attr-grid game-glyph{width:22px;height:25px;flex-basis:22px}.game-detail-information .attr-grid input{width:48px;min-width:0}.game-detail-information .attr-grid button{min-height:34px;padding:3px}.game-detail-information .muted{font-size:15px}
.slot-aptitude.grade-S,.slot-aptitude.grade-S strong{color:var(--grade-s)}.slot-aptitude.grade-A,.slot-aptitude.grade-A strong{color:var(--grade-a)}.slot-aptitude.grade-B,.slot-aptitude.grade-B strong{color:var(--grade-b)}.slot-aptitude.grade-C,.slot-aptitude.grade-C strong{color:var(--grade-c)}
effect-word.effect-original{display:block;max-width:100%;height:auto;filter:none!important;opacity:1!important}.effect-original canvas{width:100%;height:100%;filter:none!important;opacity:1!important}.effect-surface{background:transparent!important}
.reset-warning,.notice-message{font-size:17px;line-height:1.7;margin:18px 0}.reset-backup-note{background:#263c2b;border:1px solid #72976f;padding:12px;color:#d8ecd5;line-height:1.6}.reset-error{color:#ffb0a5;line-height:1.6}.reset-actions{display:flex;gap:8px;flex-wrap:wrap}.reset-actions button{min-height:42px;font-size:16px;flex:1;padding:6px 10px;white-space:nowrap}.estate-shortcuts .reset-lord{color:#6b2822}.home-reset{font-size:16px;color:#d1b087}.estate-shortcuts{gap:5px}
@media(max-width:1250px) and (min-width:701px){.game-detail-layout{grid-template-columns:24px minmax(140px,195px) minmax(0,1fr) 24px;gap:6px}.game-detail-panel{grid-template-columns:minmax(0,1fr) 52px;gap:5px}.game-aptitude{font-size:15px;gap:3px}.game-aptitude b{font-size:20px}.game-aptitude game-glyph{width:20px;flex-basis:20px}.game-stat{font-size:16px;gap:4px}.game-stat strong{font-size:19px}.game-stat-growth{font-size:16px}.game-stats{gap:8px}.game-stat game-glyph{width:21px;flex-basis:21px}.game-skill-heading strong{font-size:17px}.game-skill-type{font-size:15px}}
@media(max-width:1100px){
 .effect-surface>.effect-original{display:none}.effect-mobile-words{display:flex}
 .estate-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}.estate-shortcuts>button{min-height:34px;height:34px}
 .home-reset{font-size:13px;min-height:34px;padding:3px 5px}.shell:has(>.home)>.topbar{flex-wrap:wrap;height:auto;min-height:54px;max-height:88px;justify-content:center}.shell:has(>.home) .top-title{flex:1 0 100%;justify-content:center}.shell:has(>.home) .top-title h1{font-size:19px}.shell:has(>.home) .top-actions{width:100%;justify-content:flex-end}.shell:has(>.home) .top-actions .ghost{min-height:28px;padding:2px 8px;font-size:13px}
 .game-hero-dialog{max-height:calc(100dvh - 16px);overflow:auto}
}
@media(max-width:700px){
 .game-hero-dialog{padding:9px 6px}.game-hero-dialog .dialog-title{padding:0 3px 7px;margin-bottom:8px}.game-hero-dialog .dialog-title h2{font-size:20px}
 .game-detail-layout{grid-template-columns:20px minmax(0,1fr) 20px;gap:4px;position:relative}.game-detail-portrait{grid-column:2;grid-row:1;position:static;display:grid;grid-template-columns:minmax(80px,110px) minmax(0,1fr);gap:10px;align-items:start}.game-detail-portrait .detail-art{grid-column:1;grid-row:1;align-self:start;max-height:200px}.game-detail-portrait .portrait-settings{grid-column:2;grid-row:1;padding:0;gap:5px;font-size:14px}.game-detail-portrait .portrait-rank,.portrait-level{grid-template-columns:32px minmax(0,1fr);gap:3px}.game-detail-portrait .portrait-rank select{font-size:14px;height:32px}.level-stepper{height:38px}.level-step-buttons button{height:18px}.game-detail-portrait .bonus-check{font-size:14px;min-height:30px;padding:4px}.portrait-extra button,.detail-replace{min-height:32px;font-size:14px}
 .detail-nav{grid-row:1;position:sticky;top:45dvh;margin-top:60px;width:20px;font-size:23px}.detail-prev{grid-column:1}.detail-next{grid-column:3}
 .game-detail-panel{grid-row:2;grid-column:2;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:10px}.game-detail-tabs{grid-row:1;grid-column:1;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:auto;gap:3px}.game-detail-information{grid-row:2;padding:8px 5px}.game-detail-tab{clip-path:polygon(0 0,88% 0,100% 22%,100% 100%,0 100%);aspect-ratio:auto;min-height:38px;padding:4px 2px;background:linear-gradient(#4d4337,#2d2b26);border:1px solid #8a7553!important;font-size:13px;white-space:nowrap}.game-detail-tab.active{background:linear-gradient(#864b2d,#44261f);color:#ffe1a2}.game-detail-tab .detail-tab-art{display:none}.game-detail-tab>span{position:static;clip-path:none;overflow:visible;width:auto;height:auto;display:block}
 .game-aptitudes h3{font-size:17px}.game-aptitude-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:12px}.game-aptitude{font-size:14px;gap:3px;padding:4px 2px}.game-aptitude b{font-size:18px}.game-aptitude game-glyph{width:19px;height:22px;flex-basis:19px}
 .game-stats{grid-template-columns:minmax(0,1fr);gap:5px;margin-bottom:10px;padding-bottom:10px}.game-stat{font-size:17px;padding:4px 6px}.game-stat strong{font-size:20px}.game-stat-growth{font-size:17px;margin-left:6px}.game-stat game-glyph{width:23px;height:26px;flex-basis:23px}
 .game-skill-heading{grid-template-columns:27px minmax(0,1fr) auto 30px;gap:4px}.game-skill-heading .grade{width:25px;height:27px;font-size:19px;line-height:23px}.game-skill-heading strong{font-size:15px}.game-skill-type{font-size:12px}.game-skill-heading .ghost{font-size:13px;padding:1px}.game-skill p{font-size:14px;line-height:1.6;margin-left:31px}.game-skill-empty{font-size:15px;min-height:54px}
 .game-detail-information .attr-grid{grid-template-columns:55px minmax(0,1fr) 28px 38px 28px;gap:3px;font-size:14px}.game-detail-information .attr-grid input{width:38px;padding:3px}.game-detail-information .attr-grid>span:first-child{gap:2px}.game-detail-information .attr-grid game-glyph{width:16px;height:22px;flex-basis:16px}.game-detail-information .muted{font-size:12px;line-height:1.5}.reset-actions button{font-size:14px;padding:6px}.reset-warning{font-size:16px}
}
@media(max-width:1100px) and (max-height:480px){.estate-shortcuts{grid-template-columns:repeat(5,minmax(0,1fr))}.estate-shortcuts>button{height:30px;min-height:30px}.shell:has(>.home)>.topbar{flex-wrap:nowrap;height:44px;min-height:44px}.shell:has(>.home) .top-title{flex:1 1 auto}.shell:has(>.home) .top-actions{width:auto}}
@media(min-width:701px) and (max-width:960px){.game-aptitude-list{grid-template-columns:repeat(3,minmax(0,1fr))}.game-stats{grid-template-columns:minmax(0,1fr)}}
@media(min-width:1101px) and (max-height:740px){.estate-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));width:330px;top:130px}.estate-shortcuts>button{min-height:34px;height:34px;padding:4px;font-size:15px}}
.roster-row .apt-S{color:var(--grade-s)}.roster-row .apt-A{color:var(--grade-a)}.roster-row .apt-B{color:var(--grade-b)}.roster-row .apt-C{color:var(--grade-c)}
@media(max-width:380px){.game-detail-tab{font-size:12px;white-space:normal;word-break:break-all;line-height:1.3}.game-detail-portrait{grid-template-columns:85px minmax(0,1fr);gap:6px}}

/* Home actions: one notice in the header, four equal menu buttons. */
.shell:has(>.home)>.topbar{display:grid;grid-template-columns:160px minmax(0,1fr) 160px;grid-template-rows:auto;height:78px;min-height:78px;max-height:none;gap:12px;padding:10px 20px;align-items:center}
.shell:has(>.home)>.topbar .top-title{grid-column:2;grid-row:1;min-width:0;width:auto;padding:0;justify-content:center}
.shell:has(>.home)>.topbar .top-actions{grid-column:3;grid-row:1;width:auto;min-width:0;justify-content:flex-end;flex-shrink:0}
.shell:has(>.home)>.topbar .top-actions .notices-button{display:flex;align-items:center;justify-content:center;flex:none;width:144px;min-width:144px;min-height:50px;height:50px;padding:8px 16px;border:1px solid #c4a768;border-radius:4px;background:linear-gradient(115deg,#253024,#171e17);box-shadow:inset 0 0 0 3px #0f170e,0 2px 8px #0002;color:#efdab0;font-size:22px;line-height:1.2;font-weight:600;white-space:nowrap;word-break:keep-all;writing-mode:horizontal-tb}
.shell:has(>.home)>.topbar .notices-button:hover{border-color:#eed39a;background:linear-gradient(115deg,#354332,#222c20)}
.home .home-menus{width:min(1280px,100%);grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.home .home-menus .menu-card{width:100%;height:76px;min-height:76px;padding:12px;gap:10px;min-width:0}
.home .home-menus .home-menu-icon{width:28px;height:28px;flex:0 0 28px}
.home .home-menus .menu-label strong{font-size:clamp(16px,1.4vw,22px);white-space:nowrap;line-height:1.3}
@media(max-width:1100px){
 .shell:has(>.home)>.topbar{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;height:66px;min-height:66px;max-height:66px;padding:7px 10px;gap:8px}
 .shell:has(>.home)>.topbar .top-title{grid-column:1;grid-row:1;justify-content:flex-start;flex:initial}
 .shell:has(>.home)>.topbar .top-title:before,.shell:has(>.home)>.topbar .top-title:after{display:none}
 .shell:has(>.home)>.topbar .top-title h1{font-size:clamp(17px,3vw,23px);line-height:1.3;white-space:normal;word-break:keep-all;text-align:left;letter-spacing:0}
 .shell:has(>.home)>.topbar .top-actions{grid-column:2;grid-row:1;width:auto}
 .shell:has(>.home)>.topbar .top-actions .notices-button{width:104px;min-width:104px;height:44px;min-height:44px;font-size:18px;padding:6px 10px}
 .home .home-menus{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
 .home .home-menus .menu-card{height:58px;min-height:58px;padding:8px 6px;justify-content:center;text-align:center}
 .home .home-menus .home-menu-icon{display:none}
 .home .home-menus .menu-label{width:100%;text-align:center;padding:0}
 .home .home-menus .menu-label strong{font-size:clamp(14px,4vw,18px);display:block;text-align:center;white-space:nowrap;letter-spacing:0}
 .home .home-menus .menu-label strong>span{display:none}
}
@media(max-width:600px){.home .home-menus .menu-label strong{font-size:clamp(14px,4vw,16px)}}
@media(min-width:601px) and (max-width:1100px) and (max-height:550px){
 .home{display:flex;flex-direction:row;align-items:stretch}.home-scene{flex:1;min-height:0}.home-controls{flex:0 0 48%;width:48%;max-width:420px;padding:8px;justify-content:center}.home .home-menus{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.home .home-menus .menu-card{height:48px;min-height:48px}.home .home-menus .menu-label strong{font-size:14px}.shell:has(>.home)>.topbar{height:54px;min-height:54px;max-height:54px}.shell:has(>.home)>.topbar .top-actions .notices-button{height:40px;min-height:40px}
}
/* One forest-green surface, including the video's unused letterbox area. */
.shell:has(>.home),.shell:has(>.home)>.topbar,.home,.home-scene,.home-video,.home-controls,.home-footer{background:#1d281e;box-shadow:none}
.home{position:relative}.home-scene{box-shadow:none}

.home .home-note{display:block;font-size:14px;line-height:1.65;color:#c7c0ab;word-break:keep-all;overflow-wrap:anywhere}
.home-ratio-note{font-size:14px}
.home-flames{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none}
.dialog p,.dialog-title h2,.reset-warning,.reset-backup-note,.reset-error,.notice-message{word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
.dialog-title h2{line-height:1.45;min-width:0}.dialog-title .close{flex-shrink:0}
.share-dialog:has(.fleet-share-tabs){width:min(1420px,96vw);display:flex;flex-direction:column;max-height:94dvh;overflow:hidden}
.fleet-share-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin:0 0 10px;flex-shrink:0}
.fleet-share-tabs .metal{min-width:0;padding:6px;font-size:16px;min-height:40px}
.share-dialog .estate-share-preview{min-height:0;overflow:auto;text-align:center;flex:1;padding:0;background:#171d19}
.share-dialog .estate-share-preview img{display:block;max-width:100%;width:100%;height:auto;margin:auto;object-fit:contain}
.share-dialog .estate-share-preview.single-panel img{width:auto;max-height:60dvh;max-width:100%}
.fleet-share-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;flex-shrink:0;color:#d6c4a2;font-size:16px;word-break:keep-all}
.fleet-share-bottom small{font-size:13px;color:#bbb29d}.fleet-share-bottom .metal{flex-shrink:0;white-space:nowrap}
@media(max-width:1100px){

 .home .home-note{font-size:13px;line-height:1.5}.home-ratio-note{font-size:12px}
 .estate-shortcuts>button[data-action="share-estate"]{font-size:clamp(11px,2.8vw,15px);white-space:nowrap;gap:3px}
 .share-dialog:has(.fleet-share-tabs){width:100%;max-height:calc(100dvh - 16px);padding:12px 8px}
 .fleet-share-tabs{gap:4px;margin-bottom:8px}.fleet-share-tabs .metal{font-size:14px;padding:5px 2px}
 .fleet-share-bottom{flex-direction:column;align-items:stretch;gap:8px;font-size:14px;padding-top:8px}.fleet-share-bottom>span{text-align:center}.fleet-share-bottom .metal{text-align:center;min-height:44px}
 .share-dialog .estate-share-preview.single-panel img{max-height:none;width:100%}
}

/* Unified detail controls and a stable, compact dialog for every tab. */
.dialog.game-hero-dialog{width:min(1180px,calc(100vw - 24px));height:min(724px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);padding:14px 12px;display:flex;flex-direction:column;overflow:hidden;background:linear-gradient(135deg,#3c403e,#252826);border:1px solid #baa174;border-radius:7px;box-shadow:0 18px 60px #0009,inset 0 0 0 3px #d5bd8030}
.game-hero-dialog>.dialog-title{flex:0 0 auto;margin:0 0 12px;padding:0 8px 10px}.game-hero-dialog>.dialog-title h2{font-size:25px}
.game-detail-layout{flex:1;min-height:0;display:grid;grid-template-columns:24px minmax(160px,210px) minmax(0,1fr) 24px;gap:10px;align-items:stretch}
.game-detail-portrait{position:static;min-height:0;overflow:auto;scrollbar-width:thin;display:block;padding:0 2px}.game-detail-portrait .detail-art{width:100%;aspect-ratio:2/3;max-height:none}
.game-detail-portrait .portrait-settings{display:grid;gap:6px;padding-top:8px;font-size:15px}
.game-detail-portrait .portrait-settings .metal{box-sizing:border-box;min-height:38px;height:38px;width:100%;margin:0;border:1px solid #897a60;border-radius:5px;background:#c6bca5 url('assets/game-button-clean.png') center/100% 100%;color:#342c23;box-shadow:inset 0 0 0 1px #f3e5c580,0 1px 3px #0005;font-size:15px;font-weight:600;text-shadow:0 1px #ffffff55;padding:0 10px;line-height:1.3}
.game-detail-portrait .portrait-settings .portrait-rank,.game-detail-portrait .portrait-settings .portrait-level{display:grid;grid-template-columns:48px minmax(0,1fr);gap:4px;align-items:center}
.game-detail-portrait .portrait-rank select{appearance:auto;background:transparent;color:#342c23;border:0;border-left:1px solid #82725766;border-radius:0;box-shadow:none;height:28px;width:100%;padding:2px 4px;font:inherit;cursor:pointer}
.game-detail-portrait .portrait-rank select option{color:#342c23;background:#e3dcc8}
.game-detail-portrait .level-stepper{background:transparent;border:0;border-left:1px solid #82725766;border-radius:0;height:28px;box-shadow:none}
.game-detail-portrait .level-stepper input{color:#342c23;font:inherit;text-align:left;padding:2px 5px;height:28px;background:transparent;border:0;box-shadow:none;width:100%;min-width:0}
.game-detail-portrait .level-step-buttons{width:26px;flex-basis:26px}.game-detail-portrait .level-step-buttons button{width:26px;height:14px;min-height:14px;padding:0;border:0;border-left:1px solid #82725766;background:#a89a7b55;color:#493b22;font-size:9px;line-height:12px}.game-detail-portrait .level-step-buttons button+button{border-top:1px solid #82725766}
.game-detail-portrait .portrait-settings .bonus-check{position:relative;display:flex;justify-content:space-between;align-items:center;gap:5px;cursor:pointer}
.game-detail-portrait .bonus-check input{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;opacity:0}
.game-detail-portrait .bonus-check small{font-size:12px;color:#645941;margin:0}.game-detail-portrait .bonus-check:has(input:checked){background-image:linear-gradient(#f2d992,#b28b48);border-color:#d8bb79}.game-detail-portrait .bonus-check:has(input:checked) small{color:#493719;font-weight:700}.game-detail-portrait .bonus-check:focus-within{outline:2px solid #f2d992;outline-offset:2px}.game-detail-portrait .bonus-check.unavailable{opacity:.65;cursor:default}
.game-detail-portrait .portrait-extra{display:grid;grid-template-columns:1fr 1fr;gap:6px}.game-detail-portrait .portrait-settings .metal:hover{filter:brightness(1.08)}
.game-detail-panel{min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:42px minmax(0,1fr);gap:10px;align-items:stretch}
.game-detail-tabs{grid-row:1;grid-column:1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:42px;gap:6px}
.game-detail-tabs .game-detail-tab{display:flex;align-items:center;justify-content:center;width:100%;height:42px;min-height:42px;aspect-ratio:auto;clip-path:none;padding:5px;border:1px solid #897a60!important;border-radius:5px!important;background:#c6bca5 url('assets/game-button-clean.png') center/100% 100%;color:#342c23;font-size:17px;font-weight:600;box-shadow:inset 0 0 0 1px #f3e5c580,0 1px 3px #0005!important;white-space:nowrap}
.game-detail-tabs .game-detail-tab.active{background-image:linear-gradient(#f2d992,#b28b48);border-color:#edce89!important;color:#352411}.game-detail-tabs .game-detail-tab>span{position:static;display:block;width:auto;height:auto;clip-path:none;overflow:visible}.game-detail-tabs .game-detail-tab:hover{filter:brightness(1.1)}
.game-detail-information{grid-row:2;grid-column:1;min-height:0;overflow:auto;scrollbar-gutter:stable;padding:10px 12px;background:#242925a8;border:1px solid #68664f;border-radius:6px;box-shadow:none}
.game-aptitudes h3{font-size:19px;line-height:1.3;margin:0 0 8px}.game-aptitude-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-bottom:12px}
.game-aptitude{height:38px;min-height:38px;padding:3px 6px;border:1px solid #948a7266;border-radius:6px;background:#343830;box-shadow:inset 0 1px #fff1;font-size:17px;gap:5px;line-height:1.2;color:var(--apt-color)}
.game-aptitude b{font-size:22px;text-shadow:none}.game-aptitude game-glyph{width:23px;height:25px;flex:0 0 23px}
.detail-nav{position:static;align-self:center;margin:0;width:24px;height:64px;font-size:24px}
.game-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 0 12px;margin:0 0 12px;border-bottom:1px solid #68664f}
.game-stat{display:block;min-width:0;padding:7px 9px;border:1px solid #76634244;border-radius:5px;background:#1c211e80;white-space:normal}
.stat-heading{display:flex;align-items:center;gap:5px;min-width:0;margin-bottom:4px}.game-stat-label{font-size:17px;letter-spacing:.04em}.game-stat game-glyph{width:20px;height:23px;flex:0 0 20px}.game-stat-growth{margin-left:auto;font-size:15px;color:#8cc59c}
.stat-comparison{display:flex;justify-content:center;align-items:center;gap:7px;white-space:nowrap;font-size:17px;font-variant-numeric:tabular-nums;line-height:1.4}.stat-before{color:#cec8b8}.stat-arrow{color:#c6aa71}.stat-comparison .stat-after{margin:0;font-size:19px;color:#f0d491;font-weight:600}.stat-added{color:#aaa38f;font-size:14px;min-width:24px}.stat-added.has-bonus{color:#e3c075}
.game-detail-information .bonus-total{margin:4px 0 6px;gap:12px;font-size:15px;line-height:1.3}.bonus-total strong{font-size:23px}.game-detail-information .bonus-breakdown{gap:5px;margin:0 0 8px}.game-detail-information .bonus-breakdown span{padding:3px 7px;border-radius:4px;font-size:12px;line-height:1.5}
.game-detail-information .allocation-summary{padding:7px 8px;border-radius:4px;font-size:15px;margin:0 0 5px}
.game-detail-information .attr-grid{display:grid;grid-template-columns:64px minmax(0,1fr) 32px 44px 32px;gap:6px;margin:0;padding:6px 0;min-height:46px;font-size:16px;align-items:center}
.game-detail-information .attr-grid .stat-comparison{font-size:17px;gap:7px}.game-detail-information .attr-grid input{width:44px;height:32px;padding:3px;font-size:16px}.game-detail-information .attr-grid .icon-btn{width:32px;min-width:32px;height:32px;min-height:32px;padding:0;font-size:20px}
.game-detail-information>.dialog-actions{margin-top:10px;padding:0;gap:8px}.game-detail-information>.dialog-actions .metal{min-height:36px;font-size:15px;padding:4px 18px}
.game-skill{padding:7px 0}.game-skill-heading strong{font-size:18px}.game-skill-type{font-size:14px}.game-skill p{font-size:14px;line-height:1.5;margin:5px 5px 2px 43px}.game-skill-empty{min-height:58px;padding:8px;font-size:16px}
.game-hero-dialog>.candidate-actions{flex:0 0 auto;margin:8px 0 0;padding:0 8px;font-size:14px}.game-hero-dialog>.candidate-actions button{min-height:36px;padding:4px 22px}
@media(min-width:761px) and (max-width:1000px){
 .game-detail-layout{grid-template-columns:20px 170px minmax(0,1fr) 20px;gap:6px}.game-detail-tabs .game-detail-tab{font-size:14px}.game-detail-information{padding:8px}.game-aptitude{font-size:14px;gap:3px;padding:3px}.game-aptitude b{font-size:19px}.game-aptitude game-glyph{width:18px;flex-basis:18px}.game-stat-label{font-size:15px}.game-stat-growth{font-size:13px}.stat-comparison{font-size:14px;gap:4px}.stat-comparison .stat-after{font-size:16px}.stat-added{font-size:12px;min-width:20px}.game-detail-information .attr-grid{grid-template-columns:52px minmax(0,1fr) 28px 36px 28px;gap:4px}.game-detail-information .attr-grid .stat-comparison{font-size:14px;gap:4px}.game-detail-information .attr-grid input{width:36px}.game-detail-information .attr-grid .icon-btn{width:28px;min-width:28px}
}
@media(max-width:760px){
 .dialog.game-hero-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:10px 6px}.game-hero-dialog>.dialog-title{padding:0 5px 8px;margin-bottom:8px}.game-hero-dialog>.dialog-title h2{font-size:21px}
 .game-detail-layout{grid-template-columns:20px minmax(0,1fr) 20px;grid-template-rows:auto minmax(0,1fr);gap:8px 4px}
 .game-detail-portrait{grid-column:2;grid-row:1;position:static;display:grid;grid-template-columns:minmax(74px,100px) minmax(0,1fr);gap:8px;overflow:visible;padding:0;align-items:start}
 .game-detail-portrait .detail-art{grid-row:1;grid-column:1;max-height:150px}.game-detail-portrait .portrait-settings{grid-row:1;grid-column:2;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:0}
 .game-detail-portrait .portrait-settings .metal{font-size:12px;height:34px;min-height:34px;padding:0 6px}.game-detail-portrait .portrait-settings .portrait-rank,.game-detail-portrait .portrait-settings .portrait-level{grid-column:1/-1;grid-template-columns:40px minmax(0,1fr)}
 .game-detail-portrait .portrait-extra{grid-column:1/-1;gap:5px}.game-detail-portrait .bonus-check small{font-size:10px}.game-detail-portrait .portrait-settings .bonus-check{padding:0 4px;gap:2px;font-size:11px;white-space:nowrap}.game-detail-portrait .detail-replace{grid-column:1/-1}
 .game-detail-panel{grid-row:2;grid-column:1/-1;margin:0;min-height:0;grid-template-rows:38px minmax(0,1fr);gap:7px}.game-detail-tabs{grid-template-rows:38px;gap:4px}.game-detail-tabs .game-detail-tab{height:38px;min-height:38px;font-size:13px;padding:3px 1px}
 .detail-nav{position:static;grid-row:1;align-self:center;margin:0;width:20px;font-size:20px}.detail-prev{grid-column:1}.detail-next{grid-column:3}
 .game-detail-information{padding:8px 6px;scrollbar-gutter:auto}.game-aptitudes h3{font-size:16px;margin-bottom:6px}.game-aptitude-list{gap:4px;margin-bottom:10px}.game-aptitude{height:34px;min-height:34px;padding:3px 2px;font-size:11px;gap:2px}.game-aptitude b{font-size:17px}.game-aptitude game-glyph{width:15px;height:19px;flex-basis:15px}
 .game-stats{gap:5px;margin-bottom:8px;padding-bottom:8px}.game-stat{padding:5px}.stat-heading{gap:3px}.game-stat-label{font-size:14px}.game-stat game-glyph{width:17px;height:20px;flex-basis:17px}.game-stat-growth{font-size:12px;margin-left:auto}.stat-comparison{font-size:13px;gap:3px}.stat-comparison .stat-after{font-size:15px}.stat-added{font-size:11px;min-width:18px}
 .game-detail-information .attr-grid{grid-template-columns:45px minmax(0,1fr) 28px 34px 28px;gap:3px;min-height:44px;padding:5px 0;font-size:13px}.game-detail-information .attr-grid .stat-comparison{font-size:13px;gap:3px}.game-detail-information .attr-grid .icon-btn{width:28px;min-width:28px;height:32px;font-size:17px}.game-detail-information .attr-grid input{width:34px;font-size:14px}.game-detail-information .attr-grid game-glyph{width:16px;flex-basis:16px}
 .game-skill-heading{grid-template-columns:28px minmax(0,1fr) auto 32px;gap:4px}.game-skill-heading strong{font-size:15px}.game-skill-type{font-size:12px}.game-skill-heading .ghost{font-size:13px}.game-skill p{margin-left:32px;font-size:13px}.game-skill-empty{min-height:50px;font-size:14px}
 .game-hero-dialog>.candidate-actions{font-size:12px;gap:5px;padding:0}.game-hero-dialog>.candidate-actions button{font-size:14px;min-height:34px;padding:4px 14px}
}
@media(max-width:370px){.game-detail-portrait{grid-template-columns:78px minmax(0,1fr)}.game-detail-portrait .bonus-check small{display:none}.game-stat-growth{font-size:11px}.stat-comparison{gap:2px;font-size:12px}.stat-comparison .stat-after{font-size:14px}.game-detail-information .attr-grid{grid-template-columns:39px minmax(0,1fr) 25px 30px 25px;gap:2px}.game-detail-information .attr-grid input{width:30px}.game-detail-information .attr-grid .icon-btn{width:25px;min-width:25px}.game-detail-information .attr-grid .stat-comparison{font-size:12px;gap:2px}}

/* Keep the PC notice in its own line above the castle scene. */
.shell>.pc-optimized-note{position:static;flex:0 0 auto;align-self:stretch;width:100%;max-width:none;box-sizing:border-box;margin:0;padding:5px 20px 7px;background:#1d281e;color:#efdab0;font-size:18px;font-weight:600;line-height:1.5;white-space:nowrap;text-align:left}
@media(max-width:1100px){.shell>.pc-optimized-note{font-size:clamp(11px,3.2vw,16px);padding:4px 10px 6px}}
/* Reserve the army-name row before the user names the army. */
.game-army-info .game-info-name{min-height:42px;padding:8px 6px;flex-wrap:nowrap}
.game-army-info:has(.game-custom-name) .game-info-name strong{visibility:visible}
.game-army-info .game-custom-name{position:static;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;max-width:none;min-height:44px;height:auto;margin:0;padding:5px 6px;background:#302c2360;border-bottom:1px solid #d7c39966;box-sizing:border-box;overflow:hidden}
.game-custom-name>span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;color:#fff1c8}.game-custom-name>span.name-placeholder{color:#d0c4aa}
.game-custom-name>.metal{flex:0 0 auto;min-height:32px;padding:5px 8px;font-size:12px;white-space:nowrap;text-shadow:none}
@media(max-width:1100px){
 .unit-top{grid-template-rows:174px minmax(0,1fr) 30px}
 .game-army-info{grid-template-rows:26px 25px 32px 32px 36px;gap:4px}
 .game-army-info .game-info-name{min-height:25px;padding:0 4px}.game-info-name strong{font-size:15px}
 .game-army-info .game-custom-name{min-height:32px;height:32px;padding:2px 4px;gap:4px}.game-custom-name>span{font-size:14px}.game-custom-name>.metal{min-height:28px;height:28px;padding:3px 5px;font-size:11px}
}
@media(max-width:1100px) and (max-height:580px){
 .unit-top{grid-template-rows:148px minmax(0,1fr) 24px}.game-army-info{grid-template-rows:22px 22px 28px 26px 30px;gap:2px}.game-army-info .game-info-name{min-height:22px}.game-army-info .game-custom-name{min-height:28px;height:28px}.game-custom-name>.metal{height:24px;min-height:24px}
}
@media(min-width:601px) and (max-width:1100px) and (max-height:480px){.unit-top{grid-template-rows:minmax(0,1fr) 24px}.game-army-info{height:148px}}

/* Keep native form controls inside their centered metallic shells. */
.game-detail-portrait .portrait-settings .metal{display:flex;align-items:center;justify-content:center;text-align:center}
.game-detail-portrait .portrait-settings .portrait-rank>span,.game-detail-portrait .portrait-settings .portrait-level>span:first-child{display:flex;align-items:center;justify-content:center;align-self:stretch;text-align:center}
.game-detail-portrait .portrait-rank select{min-height:0;height:28px;max-width:none;line-height:normal;padding:0 4px;text-align:center;text-align-last:center;align-self:center}
.game-detail-portrait .level-stepper{align-items:center}
.game-detail-portrait .level-stepper input{min-height:0;height:28px;padding:0 4px;line-height:normal;text-align:center;align-self:center}
.game-detail-portrait .level-step-buttons button{display:flex;align-items:center;justify-content:center;line-height:1}
.game-detail-portrait .portrait-settings .bonus-check{justify-content:center;gap:8px}
.game-detail-portrait .bonus-check>span,.game-detail-portrait .bonus-check small{line-height:1.3;text-align:center}
.game-aptitude.grade-B{background:linear-gradient(#52647d,#35475f);border-color:#81a0cf88}
/* Every tactic occupies a complete box; its badge stays inside the padding. */
.game-skill-list{min-width:0}
.game-skill,.game-skill-empty{min-width:0;width:100%;border:1px solid #655d49;border-radius:5px;padding:8px;overflow:hidden}
.game-skill-heading{min-width:0;grid-template-columns:30px minmax(0,1fr) auto 36px;gap:6px}
.game-skill-heading .grade{position:static;transform:none;width:28px;height:28px;line-height:1;font-size:21px;display:grid;place-items:center}
.game-skill-heading strong{background:none;overflow-wrap:anywhere;padding:0}
.game-skill-type{white-space:nowrap}
.game-skill p{margin:5px 0 0 36px}
/* Details show the current value and growth; only allocation compares values. */
.game-stat{display:flex;align-items:center;gap:5px;min-height:42px}
.game-stat-label{white-space:nowrap;flex:none}
.game-stat-values{display:flex;align-items:baseline;justify-content:flex-end;flex-wrap:wrap;column-gap:5px;margin-left:auto;font-variant-numeric:tabular-nums}
.game-stat .stat-current-value{margin:0;font-size:19px;font-weight:400;color:#cec8b8}
.game-stat-values .game-stat-growth{margin:0;font-size:15px;white-space:nowrap;color:#8cc59c}
.stat-comparison .stat-before,.stat-comparison .stat-after{font-size:inherit;font-weight:400;color:#cec8b8}
.stat-comparison .stat-after.has-bonus,.game-stat .stat-current-value.has-bonus{color:#f0d491}
/* Cards already establish an inline-size container, so badges scale with cards. */
.deployment-badge{height:25%;padding:2% 3%;gap:0;justify-content:center;overflow:hidden}
.deployment-badge strong{font-size:13cqw;line-height:1.25}
.deployment-badge>span{font-size:9cqw;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}
@media(max-width:1000px){.game-stat .stat-current-value{font-size:16px}.game-stat-values .game-stat-growth{font-size:13px}}
@media(max-width:760px){
 .game-detail-portrait .portrait-settings .bonus-check{gap:3px}
 .game-skill-heading{grid-template-columns:25px minmax(0,1fr) auto 30px;gap:4px}
 .game-skill-heading .grade{width:24px;height:24px;font-size:18px}.game-skill p{margin-left:29px}
 .game-stat{gap:3px}.game-stat .stat-current-value{font-size:14px}.game-stat-values .game-stat-growth{font-size:12px}
}

/* Full-height control divisions with both value fields sharing one alignment. */
.game-detail-portrait .portrait-settings .portrait-rank,
.game-detail-portrait .portrait-settings .portrait-level{display:grid;grid-template-columns:48px minmax(0,1fr);gap:0;padding:0;overflow:hidden}
.game-detail-portrait .portrait-settings .portrait-rank>span,
.game-detail-portrait .portrait-settings .portrait-level>span:first-child{border-right:1px solid #82725799;height:100%;padding:0 4px}
.game-detail-portrait .portrait-rank select{height:100%;min-height:0;max-width:none;width:100%;margin:0;border:0;padding:0 6px;text-align:center;text-align-last:center;border-radius:0!important}
.game-detail-portrait .level-stepper{display:grid;grid-template-columns:minmax(0,1fr) 26px;align-items:stretch;width:100%;height:100%;border:0}
.game-detail-portrait .level-stepper input{height:100%;min-height:0;width:100%;margin:0;border:0;padding:0 6px;text-align:center;border-radius:0!important}
.game-detail-portrait .level-step-buttons{display:grid;grid-template-rows:1fr 1fr;width:26px;height:100%;border-left:1px solid #82725799}
.game-detail-portrait .level-step-buttons button{width:100%;height:100%;min-height:0;border-left:0;border-radius:0!important}
.innate-skill{display:block;text-align:left;min-height:54px;cursor:pointer}
.innate-skill:hover{background:#393d32;border-color:#bba275}
.innate-skill .game-skill-view{display:flex;align-items:center;justify-content:center}
.estate-shortcuts svg{display:block;flex:0 0 21px;width:21px;height:21px;color:currentColor}
.estate-shortcuts>button{gap:8px}
@media(max-width:1100px){.estate-shortcuts svg{flex-basis:16px;width:16px;height:16px}.estate-shortcuts>button{gap:4px}}
@media(max-width:760px){
 .game-detail-portrait .portrait-settings .portrait-rank,.game-detail-portrait .portrait-settings .portrait-level{grid-template-columns:40px minmax(0,1fr);padding:0}
 .estate-shortcuts>button{padding:3px;font-size:12px}.estate-shortcuts>button>span{min-width:0}
 .estate-shortcuts>button[data-action="share-estate"]{font-size:12px;white-space:normal}
}

/* Four-star officers retain their supplied purple cards and supported controls. */
.live-card-caption.four-star-caption{color:#db94db;background:linear-gradient(#201523ee,#321634ee 70%,#4b2551c0)}
.portrait-extra>button:only-child{grid-column:1/-1}
.stats-pending{padding:20px 10px;margin:8px 0 14px;border:1px solid #68664f;border-radius:5px;color:#c9c2b1;font-size:16px;line-height:1.6;text-align:center}

/* Shared icon and label columns; distribute characters within the same width. */
.estate-shortcuts>button{display:grid;grid-template-columns:1.15em minmax(0,7.4em);justify-content:center;align-items:center;column-gap:8px;letter-spacing:0}
.estate-shortcuts>button>svg{width:1.15em;height:1.15em;justify-self:start}
.estate-shortcuts .estate-menu-label{display:flex;align-items:center;justify-content:space-between;min-width:0;white-space:nowrap;text-align:center;line-height:1.2}
.estate-menu-label>span{flex:0 0 auto}.estate-menu-label>.label-space{flex:0 1 .35em;min-width:0}
.estate-shortcuts>button[data-action="backup-data"]{color:#245d9c}
.estate-shortcuts>button[data-action="import"]{color:#28623c}
@media(max-width:1100px){.estate-shortcuts>button{column-gap:4px}.estate-shortcuts>button[data-action="share-estate"]{font-size:14px;gap:4px}}
@media(max-width:760px){.estate-shortcuts>button[data-action="share-estate"]{font-size:12px}}
@media(max-width:1100px) and (max-height:480px){.estate-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}.estate{grid-template-rows:38px 30px 98px minmax(0,1fr) 18px}}

/* Three-star officers use the blue caption from their supplied cards. */
.live-card-caption.three-star-caption{color:#b2d5f4;background:linear-gradient(#142331ee,#172f42ee 70%,#244961e6)}
