@import url("./arena-guide-palette.css");
/* The collection's lavender window, with its own bounded reading surface. */
.arena-lobby-resources{display:grid;gap:8px}
@media(orientation:landscape) and (max-height:600px){.arena-welcome .arena-ready-count{grid-area:1/1}.arena-welcome .arena-modes{grid-area:2/1}.arena-welcome>button:disabled{grid-area:1/2}.arena-welcome>[data-arena-start]{grid-area:2/2}.arena-welcome .arena-local-reset{grid-area:3/1;align-self:start}.arena-welcome .arena-lobby-resources{grid-area:3/2;gap:6px}.arena-welcome .arena-lobby-resources .arena-button{font-size:18px;line-height:1;padding:3px;min-height:40px}}
.arena-guide{position:fixed;inset:0;box-sizing:border-box;width:min(920px,calc(100% - 32px));height:min(900px,calc(100% - 40px));height:min(900px,calc(100dvh - 40px));max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;border:4px solid #a18bac;border-image:none;border-radius:8px;background:#f8f0ff;color:#30283d;box-shadow:0 6px 0 #72597e;font:20px/1.4 PixelUI,monospace;image-rendering:pixelated;text-align:left}
.arena-guide[open]{display:flex;flex-direction:column}.arena-guide::backdrop{background:#292035a6}
.arena-guide *{box-sizing:border-box}.arena-guide img{image-rendering:pixelated;object-fit:contain}.arena-guide h2,.arena-guide h3,.arena-guide h4,.arena-guide p{margin:0}.arena-guide button{font-family:inherit}.arena-guide button:focus-visible,.arena-guide [tabindex]:focus-visible{outline:3px solid #765492;outline-offset:3px}.arena-guide [tabindex="-1"]:focus{outline:none}
.ag-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px 14px;border-bottom:2px solid #dcc9e7;background:#eee0f8}.ag-heading{display:flex;gap:14px;align-items:center}.ag-heading>.ag-glyph{width:36px;height:36px;color:#715087}.ag-eyebrow{display:block;font-size:13px;line-height:1.4;color:#745a85;font-weight:700}.ag-header h2{font:700 30px/1.2 PixelUI,monospace}.ag-close{flex:none;min-height:44px!important;font-size:19px!important}.ag-close span{margin-left:8px;font-size:24px}
.ag-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex:none;padding:10px 22px;background:#f8f0ff;border-bottom:2px solid #dcc9e7}.ag-nav button{background:#fffafc;color:#564264;border:2px solid #cab3d9;box-shadow:0 2px 0 #e1cdeb;min-height:40px;padding:6px;font-size:18px;cursor:pointer}.ag-nav button:hover{background:#ebdcf5}.ag-nav button:active{transform:translateY(2px);box-shadow:none}
.ag-scroll{overflow:auto;overscroll-behavior:contain;scrollbar-color:#b59aca #f0e4f5;scrollbar-width:thin;min-height:0;padding:22px;scroll-padding:12px;flex:1}
.ag-hero{background:#e1f1ea;border:2px solid #b0c9bc;padding:22px;display:flex;align-items:center;justify-content:space-between;gap:18px;box-shadow:0 4px 0 #c8ddd2}.ag-hero .ag-eyebrow{color:#406753}.ag-hero h3{font-size:32px;line-height:1.15;margin:8px 0 12px}.ag-hero p{color:#456654}.ag-hero-mark{display:flex;flex-direction:column;align-items:center;gap:8px;flex:none}.ag-hero-mark>img{width:80px;height:80px}.ag-hero-mark .ag-hearts b{display:none}
.ag-section{margin-top:36px;scroll-margin-top:12px}.ag-section-title{display:flex;align-items:flex-start;gap:12px;margin-bottom:18px}.ag-number{flex:none;display:grid;place-items:center;width:42px;height:42px;background:#e7d8f3;border:2px solid #ad90c1;box-shadow:3px 3px 0 #dbc5e8;font-size:21px;color:#654779}.ag-section-title h3{font-size:27px;line-height:1.2}.ag-section-title p{color:#786781;font-size:18px;margin-top:4px}.ag-section>p{margin:16px 0}.ag-section strong{color:#4d345d}
.ag-steps{list-style:none;counter-reset:step;display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 18px;padding:0}.ag-steps li{counter-increment:step;position:relative;padding:14px 14px 14px 46px;background:#fffaf7;border:2px solid #ddccd7}.ag-steps li:before{content:counter(step);position:absolute;left:12px;top:14px;background:#eddfe8;width:24px;height:24px;text-align:center;color:#6d536d;font-size:17px}.ag-steps b{display:block;font-size:21px;margin-bottom:6px}.ag-steps p{font-size:18px;color:#685a6c}
.ag-card{padding:16px;border:2px solid #d6c4df;background:#fffafc;min-width:0}.ag-card h4{font-size:21px;line-height:1.25;margin-bottom:10px}.ag-card p{font-size:18px;line-height:1.4}.ag-card p+p{margin-top:10px}.ag-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ag-modes,.ag-damage-basics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.ag-modes .ag-card h4{display:flex;justify-content:space-between;gap:8px;align-items:center}.ag-modes h4 span{white-space:nowrap;font-size:17px}.ag-card.mint{background:#e7f3e9;border-color:#b5d0ba}.ag-card.lavender{background:#eee5fa;border-color:#c5b1db}.ag-card.rose{background:#fce9e9;border-color:#dcb5be}.ag-card.cream{background:#fff4db;border-color:#dfc99f}
.ag-note{background:#f0e6f4;padding:14px 16px;border-left:4px solid #bea3cc;font-size:18px!important;color:#67546f}.ag-damage-basics{text-align:center}.ag-damage-basics .ag-hearts{margin-bottom:6px}.ag-hearts{display:inline-flex;justify-content:center;align-items:center;gap:3px;white-space:nowrap}.ag-hearts img{width:22px;height:22px}.ag-hearts b{margin-left:5px;font-size:20px;color:#67384c}
.ag-rarities{margin-top:18px}.ag-glyph{width:32px;height:32px}.ag-rarities .ag-glyph{float:right;margin-left:10px}.ag-rarities .ag-eyebrow{margin-bottom:8px;font-size:15px}.ag-card.ag-epic{background:#ede0ff;border-color:#ad86d0;box-shadow:0 3px 0 #d9c5eb;color:#573b74}.ag-epic .ag-eyebrow{color:#704899}.ag-card.ag-legendary{background:#fff0c8;border-color:#caa25a;box-shadow:0 3px 0 #ecd5a4;color:#705321}.ag-legendary .ag-eyebrow{color:#8c651e}
.ag-damage-table-wrap{margin-top:24px}.ag-damage-table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:18px;background:#fffafc}.ag-damage-table caption{text-align:left;font-size:17px;margin-bottom:8px;color:#796583}.ag-damage-table th,.ag-damage-table td{border:2px solid #ddccdf;padding:12px 8px;text-align:center;overflow-wrap:break-word}.ag-damage-table th:first-child{width:29%;text-align:left}.ag-damage-table thead{background:#eadfef}.ag-damage-table .ag-hearts img{display:none}.ag-damage-table .ag-hearts b{margin:0;font-size:24px}.ag-damage-table .ag-hearts:after{content:'♥';font-size:18px;color:#ad5578}.ag-row-gold{background:#fff4d7}.ag-row-purple{background:#f0e6fb}
.ag-critical-banner{display:flex;gap:16px;align-items:center;background:#fce5c8;padding:18px;border:2px solid #d9ac71;box-shadow:0 3px 0 #ebd2b0}.ag-critical-banner .ag-glyph{flex:none;color:#b87526;width:40px;height:40px}.ag-critical-banner h4{font-size:25px}.ag-critical-banner p{font-size:19px;margin-top:4px}.ag-reading-demo{display:flex;align-items:center;justify-content:center;gap:18px;background:#fffaf7;padding:16px;border:2px solid #dccada}.ag-reading-label{font-size:18px;color:#705e7c}.ag-reading-demo span:not(.ag-reading-label){display:flex;flex-direction:column;text-align:center;gap:6px}.ag-reading-demo b{font-size:25px}.ag-reading-demo small{font-size:17px;background:#e9ddf5;padding:2px 8px;color:#67477c}.ag-reading-demo i{font-style:normal;color:#a68dad}.ag-demo-caption{font-size:16px;color:#796783}.ag-card ul{padding-left:20px;margin:0 0 10px;font-size:18px}.ag-card li+li{margin-top:8px}
.ag-type-picker{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.ag-type-picker button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:46px;border:2px solid #c6b4cc;background:#fffafc;color:#4d4058;padding:5px;font-size:17px;cursor:pointer}.ag-type-picker button[aria-pressed=true]{background:var(--type-color);border-color:#695575;box-shadow:0 3px 0 #aa8bbc}.ag-type-picker button:hover{background:var(--type-color)}.ag-type-picker img{width:24px;height:24px}.ag-type{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border:2px solid #4d405824;background:var(--type-color);color:#3c3546;font-size:17px;line-height:1.2;white-space:nowrap}.ag-type img{width:24px;height:24px}.ag-affinities{margin-top:20px}.ag-affinity-head{display:flex;align-items:center;gap:12px;margin-bottom:12px;font-size:17px;color:#77627e}.ag-affinity-head>.ag-type{font-size:21px;padding:6px 12px}.ag-chips{display:flex;flex-wrap:wrap;gap:6px}.ag-result{margin:14px 0 8px!important;font-size:17px!important}.ag-result.good,.ag-legend .good{color:#336a4c}.ag-result.danger{color:#a34059}.ag-result.muted,.ag-legend .muted{color:#845870}.ag-muted{font-size:17px;color:#897a8d}
.ag-table-heading{margin:26px 0 12px}.ag-table-heading h4{font-size:23px}.ag-table-heading p{font-size:17px;color:#7e6886;margin-top:4px}.ag-legend{display:flex;flex-wrap:wrap;gap:8px 14px;margin-bottom:12px;font-size:16px}.ag-legend span{display:flex;align-items:center;gap:5px}.ag-legend b{display:inline-grid;place-items:center;width:22px;height:22px;background:#fffafc;border:1px solid #d7c5dd;font-size:20px}.ag-matrix-scroll{overflow:auto;max-height:540px;overscroll-behavior:contain;border:2px solid #c6b3d0;scrollbar-color:#ad92c0 #f1e6f6;scrollbar-width:thin}.ag-matrix{border-collapse:separate;border-spacing:0;font-size:17px;width:max-content;background:#fffafc}.ag-matrix caption{text-align:left;font-size:16px;padding:10px;background:#f0e6f6;caption-side:bottom}.ag-matrix th,.ag-matrix td{border-right:1px solid #d9cddf;border-bottom:1px solid #d9cddf;padding:4px;text-align:center;min-width:58px;height:42px}.ag-matrix thead th{position:sticky;top:0;z-index:2;background:#eee3f4;height:68px}.ag-matrix thead th img{display:block;width:24px;height:24px;margin:0 auto 3px}.ag-matrix thead th span{display:block;font-size:12px}.ag-matrix th:first-child{position:sticky;left:0;background:#f5ebf9;min-width:128px;z-index:1}.ag-matrix thead th:first-child{z-index:3;font-size:15px}.ag-matrix .ag-type{border:0;background:none;font-size:15px;padding:0}.ag-matrix .ag-type img{width:20px;height:20px}.ag-match{font-weight:700;font-size:22px}.ag-match.super{background:#cce6d4;color:#235b3c}.ag-match.resisted{background:#f2dce5;color:#904564}.ag-match.normal{background:#fffafc;color:#a395ad}
.ag-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:2px solid #ddcce7;margin-top:28px;padding-top:20px;font-size:24px;color:#6b4c81}.ag-footer .arena-button{font-size:21px;min-height:48px}
@media(max-width:600px){.arena-guide{width:calc(100% - 16px);height:calc(100% - 24px);height:calc(100dvh - 24px);font-size:18px}.ag-header{padding:12px;gap:8px}.ag-heading{gap:8px}.ag-heading>.ag-glyph{width:26px;height:26px}.ag-header h2{font-size:25px}.ag-header .ag-eyebrow{font-size:11px}.ag-close{padding:3px 6px!important;font-size:16px!important}.ag-close span{margin-left:3px}.ag-nav{padding:8px;gap:4px}.ag-nav button{font-size:15px;min-height:42px}.ag-scroll{padding:14px}.ag-hero{padding:16px;gap:8px}.ag-hero h3{font-size:26px}.ag-hero .ag-eyebrow{font-size:11px}.ag-hero p{font-size:17px}.ag-hero-mark>img{width:56px;height:56px}.ag-hero-mark .ag-hearts img{width:16px;height:16px}.ag-section{margin-top:28px}.ag-section-title h3{font-size:23px}.ag-section-title p{font-size:17px}.ag-number{width:34px;height:34px;font-size:19px}.ag-steps,.ag-columns,.ag-modes{grid-template-columns:1fr}.ag-modes{gap:8px}.ag-card{padding:14px}.ag-card p{font-size:18px}.ag-damage-basics{gap:6px}.ag-damage-basics .ag-card{padding:10px 5px}.ag-damage-basics h4{font-size:17px;min-height:42px;display:grid;place-items:center}.ag-damage-basics p{font-size:15px}.ag-damage-basics .ag-hearts{flex-wrap:wrap;gap:1px}.ag-damage-basics .ag-hearts img{width:16px;height:16px}.ag-damage-basics .ag-hearts b{font-size:19px;margin-left:2px}.ag-damage-table th,.ag-damage-table td{padding:8px 3px;font-size:14px}.ag-damage-table th:first-child{width:31%}.ag-damage-table .ag-hearts b{font-size:21px}.ag-damage-table .ag-hearts:after{font-size:15px}.ag-reading-demo{gap:8px;padding:12px 6px}.ag-reading-label{font-size:16px}.ag-reading-demo b{font-size:23px}.ag-reading-demo small{font-size:16px;padding:2px 5px}.ag-type-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.ag-type-picker button{font-size:16px}.ag-affinity-head{align-items:flex-start;font-size:16px}.ag-affinity-head>.ag-type{font-size:18px;padding:6px}.ag-footer{flex-direction:column;align-items:stretch;text-align:center}.ag-note{padding:12px;font-size:17px!important}}
@media(orientation:landscape) and (max-height:600px){.arena-guide{width:calc(100% - max(32px,env(safe-area-inset-left)) - max(32px,env(safe-area-inset-right)));height:calc(100dvh - 16px)}.ag-header{padding:6px 16px}.ag-heading>.ag-glyph{width:28px;height:28px}.ag-header h2{font-size:25px}.ag-header .ag-eyebrow{display:none}.ag-nav{padding:6px 16px}.ag-nav button{min-height:34px;font-size:16px}.ag-close{min-height:38px!important}.ag-scroll{padding:16px}}

/* The native bolt occupies the first 61 rows; keep its percentage outside the guide icon. */
.ag-critical-logo{display:block;flex:none;width:52px;aspect-ratio:64/61;overflow:hidden}
.ag-critical-logo>img{display:block;width:100%;height:auto;image-rendering:pixelated}

/* Stable text metrics on iOS rotation, compact tabs, literal heart diagrams. */
.arena-guide{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.ag-nav button{min-width:0;white-space:nowrap;line-height:1.15}
.ag-heading{min-width:0}.ag-header h2{font-size:clamp(20px,4.7vw,30px)}
.ag-hero>div{min-width:0;width:100%}.ag-one-line{white-space:nowrap;font-size:clamp(13px,3.85vw,20px)}
.ag-damage-table .ag-hearts img{display:block;width:clamp(12px,3.5vw,22px);height:auto}.ag-damage-table .ag-hearts:after{content:none}
.ag-reading-label{font-size:32px;font-family:Arial,'Noto Sans JP',sans-serif}
.ag-table-heading{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.ag-table-heading>button{margin-left:auto;font-size:18px;min-height:38px}.ag-table-heading>p{flex-basis:100%}
.ag-type-picker button[aria-pressed=false]:not(:hover){background:#fffafc;border-color:#c6b4cc;box-shadow:none}
.ag-expanded{width:calc(100% - 16px);height:calc(100dvh - 16px);padding:12px;gap:10px}
.ag-expanded .ag-matrix-scroll{flex:1;min-height:0;max-height:none}.ag-expanded>[data-matrix-close]{align-self:center;min-width:120px}
html body dialog.ag-expanded{position:fixed;inset:0;margin:auto;width:min(1400px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));max-width:none;max-height:none;box-sizing:border-box}
.ag-expanded>h2{margin:0;text-align:center;font-size:26px}.ag-expanded>.ag-legend{justify-content:center;flex-shrink:0;margin:4px 0}.ag-expanded .ag-matrix caption{display:none}
@media(hover:hover) and (pointer:fine){.ag-matrix-scroll{overflow:hidden;overscroll-behavior:auto;cursor:grab;user-select:none;-webkit-user-select:none}.ag-matrix-scroll[data-table-panning=true]{cursor:grabbing}}

/* Review: compact horizontal readings and centered table action. */
.ag-reading-demo{display:grid;grid-template-columns:max-content minmax(0,1fr) 12px minmax(0,1fr) 12px minmax(0,1fr);gap:12px}
.ag-reading-demo>span{min-width:0}.ag-reading-demo .ag-reading-label{text-align:center;white-space:nowrap}
.ag-reading-demo b{font-family:Arial,'Noto Sans JP',sans-serif;white-space:nowrap;word-break:keep-all;line-height:1.2}
.ag-reading-demo .ag-romaji{font:700 15px/1.2 system-ui,sans-serif;color:#766083;white-space:nowrap}
.ag-table-heading{display:flex;flex-direction:column;align-items:stretch;gap:8px}.ag-table-heading>p{flex-basis:auto}.ag-table-heading>button{align-self:center;margin:4px 0 0}
@media(max-width:600px){.ag-reading-demo{gap:6px;padding:12px 6px}.ag-reading-demo .ag-reading-label{font-size:20px}.ag-reading-demo b{font-size:20px}.ag-reading-demo .ag-romaji{font-size:13px}.ag-reading-demo small{font-size:15px;padding:2px 3px}}

/* Symmetric header columns keep the title centered on the window itself. */
html body :is(.arena-guide,.arena-collection) .arena-sheet-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:4px;flex:none;margin:0;padding:12px 8px}
html body :is(.arena-guide,.arena-collection) .arena-sheet-header>.minimal-close{position:static;grid-column:1;grid-row:1;width:44px;height:44px;min-height:44px;transform:none}
.arena-sheet-header>.ag-heading,.arena-sheet-header>h2{grid-column:2;grid-row:1;min-width:0;justify-content:center}
html body :is(.arena-guide,.arena-collection) .arena-sheet-header h2{width:100%;margin:0;text-align:center;font:400 clamp(18px,4.7vw,28px)/1.2 PixelUI,monospace;text-transform:uppercase;text-shadow:none;-webkit-text-stroke:0}
.ag-legend b{flex:none;padding:0;border-radius:50%;line-height:1}
.ag-legend b>svg{display:block;width:14px;height:14px;fill:currentColor}
html body dialog.arena-collection{position:fixed;inset:20px 16px;width:calc(100% - 32px);height:calc(100dvh - 40px);max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;font:20px/1.4 PixelUI,monospace}
html body dialog.arena-collection:not([open]){display:none}
html body dialog.arena-collection[open]{display:flex;flex-direction:column}
.arena-collection::backdrop{background:#292035a6}
.arena-collection .arena-roster{padding:16px;align-content:start;flex:1}
.arena-collection .arena-roster[hidden]{display:none}
.arena-collection-loading{padding:24px;text-align:center}
@media(orientation:landscape) and (max-height:600px){html body :is(.arena-guide,.arena-collection) .arena-sheet-header{padding-block:2px}}

/* Full-screen sheets slide over the unchanged hall (or the parent guide).
   An opaque ::backdrop switched on/off by showModal/close used to flash the
   whole viewport independently of that slide. The modal still traps input. */
html body dialog:is(.arena-guide,.arena-collection):not(#arena-sheet-a#arena-sheet-b#arena-sheet-c#arena-sheet-d#arena-sheet-e){
 position:fixed;inset:0;box-sizing:border-box;width:100%;height:100%;height:100dvh;
 max-width:none;max-height:none;margin:0;padding:0;overflow:hidden;
 border:0!important;border-image:none!important;border-radius:0!important;outline:0;box-shadow:none!important;
 background:#fff9ee!important;color:#352844;
}
html[data-ui-theme=dark] body dialog:is(.arena-guide,.arena-collection):not(#arena-sheet-a#arena-sheet-b#arena-sheet-c#arena-sheet-d#arena-sheet-e){background:#222528!important;color:#e8e9e7}
/* The guide's four step counters are pseudo-elements, outside the automatic
   surface adapter. Keep their existing size and layout in both themes. */
html[data-ui-theme=dark] .ag-steps li::before{background:var(--rm-secondary,#292c30);color:var(--rm-text,#e8e9e7);border:1px solid var(--rm-line,#42474d);border-radius:4px;box-sizing:border-box}
html body dialog:is(.arena-guide,.arena-collection)::backdrop{background:transparent;backdrop-filter:none}
html body :is(.arena-guide,.arena-collection) .arena-sheet-header{
 padding-top:max(12px,env(safe-area-inset-top));
 padding-inline:max(8px,env(safe-area-inset-left),env(safe-area-inset-right));
}
html body .arena-collection .arena-roster{min-height:0;overflow:auto;overscroll-behavior:contain}
.arena-guide .ag-scroll,.arena-collection .arena-roster{padding-bottom:max(16px,env(safe-area-inset-bottom));padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
.ag-expanded>.ag-matrix-scroll{margin-inline:max(12px,env(safe-area-inset-left),env(safe-area-inset-right))}
.ag-expanded>.ag-legend{padding:4px 12px max(12px,env(safe-area-inset-bottom))}
@media(orientation:landscape) and (max-height:600px){html body :is(.arena-guide,.arena-collection) .arena-sheet-header{padding-top:max(2px,env(safe-area-inset-top));padding-bottom:2px}}

/* Classic guide surfaces; only game labels borrow Pop's action typeface. */
html body .arena-guide :is(.ag-nav button,.ag-modes h4,.ag-damage-basics h4,.ag-rarities h4,.ag-critical-banner h4,.ag-damage-table thead th:not(:first-child)),
html body :is(.arena-guide,.ag-expanded) .ag-legend>span {
 font-family:UniversityActions,Tiny5,PixelUI,monospace!important;
 font-weight:400!important;text-transform:uppercase;
}
