/* Art slots are empty until Designer assets are approved and installed via AOMUI.
   Scope excludes #hud .me: the player's KDA/XP card must not be redesigned. */
:root {
  --aomui-surface: #071823;
  --aomui-surface-hi: #142d40;
  --aomui-metal: #b69b63;
  --aomui-highlight: #ffe2a0;
  --aomui-edge: #3b657b;
  --aomui-slice: 32;
  --aomui-border-width: 12px;
}
[data-ui-style="royal"] {
  --aomui-surface: #06152c;
  --aomui-surface-hi: #173e6b;
  --aomui-metal: #d5ae63;
  --aomui-highlight: #ffe5ad;
  --aomui-edge: #4a82ad;
}
[data-ui-style="relic"] {
  --aomui-surface: #08141d;
  --aomui-surface-hi: #1c2a37;
  --aomui-metal: #a48b58;
  --aomui-highlight: #e9d5aa;
  --aomui-edge: #39666c;
}

/* Keep tested geometry: colour, weight and surface treatment consume no extra rows. */
#end .end-team {
  background: linear-gradient(145deg, var(--aomui-surface-hi), var(--aomui-surface) 65%);
  box-shadow: inset 0 1px 0 #d0e8ff12, 0 3px 12px #0003;
}
#end .end-team h2 { font-weight: 700; text-shadow: 0 1px 2px #0008; }
#end .end-player { background: linear-gradient(90deg, #5fa8dc07, transparent 70%); }
#end .end-player.self { background: linear-gradient(90deg, #4899d82b, #4899d805); }
#end .end-name>b { font-weight: 700; }
#end .end-kda { color: #eaf3f8; font-weight: 600; font-variant-numeric: tabular-nums; }
#end .end-rating { font-weight: 800; color: var(--aomui-highlight); text-shadow: 0 1px 3px #0008; }
#end .end-items>span { box-shadow: inset 0 0 0 1px #8a9caa70, 0 1px 3px #0006; }
#menu .hinfo li b { color: #f1f5f8; font-weight: 600; }
#menu .hinfo .ht { color: #c5b68f; }
#menu .hskill-head { color: #b8ccd5; }
#menu .playp .miss h3 { font-weight: 700; color: var(--aomui-highlight); }
#menu .playp .miss li { border-bottom: 1px solid #738d9a20; }
#menu .playp .miss li em { color: #b9cbd4; }
#menu .playp .miss li.done em { color: var(--ok); }

/* 9-slice art paints inside the existing boxes. Never use art dimensions for layout. */
[data-ui-frame] :is(#end .end, #menu .showcase, #menu .playp, #end .end-team) {
  border-image-source: var(--aomui-frame);
  border-image-slice: var(--aomui-slice);
  border-image-width: var(--aomui-border-width);
  border-image-repeat: stretch;
  border-image-outset: 0;
  clip-path: none;
}
[data-ui-frame-red] .end-team.enemy { border-image-source: var(--aomui-frame-red); }
#end .end-team h2 {
  background-image: var(--aomui-team-blue, none), linear-gradient(90deg, #224b6fbb, #15364e33);
  background-size: 100% 100%;
}
#end .end-team.enemy h2 {
  background-image: var(--aomui-team-red, none), linear-gradient(90deg, #602b3abb, #361a2633);
}
#endTitle { position: relative; isolation: isolate; }
#endTitle::before {
  content: ''; position: absolute; inset: 0 15%; z-index: -1;
  background: var(--aomui-victory, none) center / contain no-repeat;
  pointer-events: none;
}
#endTitle.lose::before { background-image: var(--aomui-defeat, none); }
#end .end-mvp {
  background-image: var(--aomui-mvp, none); background-size: contain;
  background-position: left center; background-repeat: no-repeat;
}
#end .end-mvp[data-award="team"] { background-image: var(--aomui-mvp-team, none); }
[data-ui-mvp] .end-mvp { padding-inline-start: 1.5em; }
#end .end-rating { background: var(--aomui-rating, none) center / contain no-repeat; }
[data-ui-hero] .showcase {
  background-image: var(--aomui-hero), linear-gradient(150deg, var(--aomui-surface-hi), var(--aomui-surface));
  background-position: left center; background-size: auto 100%, 100% 100%; background-repeat: no-repeat;
}
#menu #wkCard { background-image: var(--aomui-weekly, none), linear-gradient(105deg, #27375b80, #7e663422); background-size: cover; }

/* Event medallions occupy fixed icon slots, not a new banner/row. Opacity/position stay with layoutBottom. */
[data-ui-boss] #bossT svg { visibility: hidden; }
[data-ui-boss] #bossT { background-image: var(--aomui-boss); background-repeat: no-repeat; background-position: 5px center; background-size: 14px 14px; }
[data-ui-event] #evPill::before, #feed[data-ui-kill]>div::before {
  content: ''; display: inline-block; width: 13px; height: 13px; margin-inline-end: 4px;
  vertical-align: -2px; background: var(--aomui-event) center / contain no-repeat;
}
#feed[data-ui-kill]>div::before { background-image: var(--aomui-kill); }
#bossTv { font-weight: 800; font-variant-numeric: tabular-nums; }
#evPill, #feed>div { text-shadow: 0 1px 2px #000b; }

/* More legible where space exists; shortest phone boxes retain their measured line heights. */
@media(min-height:541px) {
  #end .end-name>b { font-size: 13px; }
  #end .end-kda { font-size: 13px; }
  #end .end-rating { font-size: 18px; }
  #menu .hinfo h2 { letter-spacing: .01em; }
  #menu .hskill-head { font-size: 12px; }
}

/* Approved composition: A results; B lobby and notices. All content remains live DOM/canvas. */
#end .end { background: radial-gradient(ellipse at 50% 0, #174b7655, transparent 55%), linear-gradient(160deg, #102d48f5, #030d1af5); box-shadow: inset 0 0 0 1px #9e854e88, 0 16px 60px #0008; }
#end .end-team { border-color: #6b8ba0; border-radius: 8px; }
#end .end-team.enemy { border-color: #91515b; }
#end .end-team h2 { color: #d7efff; border-bottom: 1px solid #b39b5b66; }
#end .end-team.enemy h2 { color: #ffd4db; }
#end .end-team h2>b { color: #fff1c6; font-weight: 800; }
#end .end-player { border-top-color: #91abbd26; }
#end .end-player.self { box-shadow: inset 2px 0 #93dcff, inset 0 0 0 1px #6dd0ff44; }
#end .end-portrait canvas { border-radius: 50%; box-shadow: 0 0 0 1px #d6b779b0, 0 2px 5px #0008; }
#end .end-portrait>small { border-color: #bca16c; background: #071729; color: #fff3d4; }
#end .end-cols { color: #acbdcf; }
#end .end-rating-group { display: flex; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; line-height: 1; }
#end .end-player { grid-template-columns: 34px minmax(0,1fr) 76px 58px; }
#end .end-cols { grid-template-columns: minmax(0,1fr) 76px 58px; }
#end .end-rating-group .end-rating { min-width: 27px; line-height: 1.05; }
#end .end-rating-group>.end-mvp { position: static; display: grid; place-items: center; flex: none; width: 20px; height: 22px; margin: 0; padding: 0; font: 800 7px/1 var(--display); color: #fff1ba; background-color: #6c4c18; box-shadow: inset 0 0 0 1px #d4ad63; clip-path: polygon(50% 0,100% 24%,91% 74%,50% 100%,9% 74%,0 24%); }
#end .end-rating-group>.end-mvp[data-award=team] { color: #e7f4ff; background-color: #314659; box-shadow: inset 0 0 0 1px #99b2c3; }
#end[data-ui-mvp] .end-mvp[data-award=win], #end[data-ui-mvp-team] .end-mvp[data-award=team] { font-size: 0; background-color: transparent; box-shadow: none; clip-path: none; }
#endTitle.draw { background-image: linear-gradient(#fff, #a3bed6); }
#endTitle.draw::before { background-image: none; }
#end .end-actions .ghost,#end .end-actions .eshare { background: linear-gradient(#193a55,#091b2d); border-color: #b79756a0; box-shadow: inset 0 1px 0 #ddeeff20, 0 2px 6px #0005; }
#end .end-actions .go { box-shadow: inset 0 1px 0 #fff8, inset 0 -3px 0 #915e29, 0 3px 10px #0008; }

/* Left panel: identity + a real animated hero above a two-column skill kit. */
#menu .showcase { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); grid-template-rows: minmax(0,1fr) auto auto; align-items: stretch; gap: 8px; background-color: var(--aomui-surface); background-image: var(--aomui-hero, none), radial-gradient(ellipse at 75% 40%, #36545a44, transparent 65%), linear-gradient(150deg,#152732,#061018); background-position: right top; background-size: auto 78%,100% 100%,100% 100%; background-repeat: no-repeat; }
#menu #heroInfo { display: contents; }
#menu .hero-identity { grid-column: 1; grid-row: 1; display: grid; align-content: center; gap: 8px; min-width: 0; }
#menu .hero-identity h2 { margin: 0; font: 800 clamp(24px,3vw,40px)/1.1 var(--display); color: #edf4f5; }
#menu .hero-identity .ht { font-size: 11px; color: #c4b587; }
#menu .hero-identity .hcd { color: #a6bec7; font-size: 11px; }
#menu .hero-identity .hbars { width: 100%; font-size: 10px; gap: 4px 7px; }
#menu .hero-identity .hbars i { height: 4px; }
#menu .showcase .hleft { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: center; min-height: 0; height: 100%; }
#menu #showCv { width: 100%; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
#menu .hero-kit { grid-column: 1/-1; grid-row: 2; display: grid; gap: 5px; min-width: 0; padding-top: 6px; border-top: 1px solid #c4a46955; }
#menu .hero-kit .hskill-head { font-weight: 700; letter-spacing: .02em; }
#menu .hero-kit ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 10px; }
#menu .hero-kit li { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 6px; align-items: center; min-width: 0; margin: 0; padding: 3px 0; font-size: 13px; line-height: 1.25; }
#menu .hero-kit li img { width: 26px; height: 26px; border: 1px solid #8f855a80; border-radius: 50%; }
#menu .hero-kit li.pas::before { content: '✦'; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #e3c786; background: #2a3e44; box-shadow: inset 0 0 0 1px #9c8d58; font-size: 19px; }
#menu .hero-kit li b { overflow-wrap: anywhere; color: #f2f5f5; }
#menu .hero-kit li .d,#menu .hero-kit li .man { display: none; }
#menu .showcase .skins { grid-column: 1/-1; grid-row: 3; }
#menu .hmore { border-color: #bda16c; background: linear-gradient(#283d45,#0d1d25); color: #f3dba4; }
#menu .showcase .hleft>.hnb { z-index: 1; border-radius: 3px 3px 7px 3px; padding: 3px 7px; background: linear-gradient(#f3d894,#b59149); color: #241d0e; box-shadow: 0 2px 6px #0006; }

/* Central controls remain their own rows; only the mission list takes scrolling. */
#menu .playp { background: linear-gradient(145deg,#14232e,#060f18); box-shadow: inset 0 0 0 1px #937f5166, inset 0 1px 0 #ddf2ff13; }
#menu .play-emblem { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; opacity: .85; }
#menu .qp b { padding-left: 28px; }
#menu .qp { border-radius: 8px; background: linear-gradient(#f8df9f,#d0a650 70%,#a97f35); box-shadow: inset 0 1px 0 #fff8,inset 0 -3px 0 #8e672c,0 3px 10px #0005; }
#menu .pb { background: linear-gradient(#233641,#0b1721); border-color: #7c725744; box-shadow: inset 0 1px 0 #cbe7ee12; }
#menu .pb.rank { border-color: #b69b6380; }
#menu #wkCard { border-color: #8d86ae99; border-radius: 7px; box-shadow: inset 0 1px 0 #f8edff18; }
#menu .playp .miss { padding-top: 5px; border-top: 1px solid #977f5055; }
#menu .playp .miss h3 { color: #e3c995; }
#menu .playp .miss>ul { scrollbar-width: thin; scrollbar-color: #8a784d #0a1920; }
#menu .playp .miss .claim { background: linear-gradient(#e8cb83,#b08b45); color: #211a0c; border-color: #dec184; font-weight: 700; }

/* Match notices B: scale-independent reading size, faint and clear of the skill pad. */
#topRow .bosst { font-size: calc(10.5px / var(--uib,1)); padding: calc(3px / var(--uib,1)) calc(8px / var(--uib,1)); gap: calc(4px / var(--uib,1)); border-radius: 5px; background-color: #081721cc; box-shadow: inset 2px 0 #c1a061,inset 0 0 0 1px #8b784c70; }
#topRow .bosst svg { width: calc(13px / var(--uib,1)); height: calc(13px / var(--uib,1)); }
#topRow .evp { font-size: calc(10px / var(--uib,1)); padding: calc(3px / var(--uib,1)) calc(7px / var(--uib,1)); border-radius: 5px; background-color: #081721aa; box-shadow: inset 2px 0 #8c9d9c; }
#feed>div { font-size: calc(10px / var(--ui,1)); line-height: 1.25; padding: calc(3px / var(--ui,1)) calc(7px / var(--ui,1)); border-left: 2px solid #bca367; border-right: 0; border-radius: 5px; background: #081721aa!important; max-width: calc(215px / var(--ui,1)); box-shadow: inset 0 0 0 1px #8b784c40!important; }
#feed>.k0 { border-left-color: #87bed3; }#feed>.k1 { border-left-color: #c88791; }
#feed>div:nth-last-child(n+4) { display: none; }
#feed[data-ui-kill]>div::before { width: calc(13px / var(--ui,1)); height: calc(13px / var(--ui,1)); }
#topRow[data-ui-event] #evPill::before { width: calc(13px / var(--uib,1)); height: calc(13px / var(--uib,1)); }

@media(max-width:1050px) {
 #end .end-player { grid-template-columns: 28px minmax(0,1fr) 64px 44px; }
 #end .end-cols { grid-template-columns: minmax(0,1fr) 68px 44px; }
 #end .end-rating-group>.end-mvp { width: 15px; height: 17px; font-size: 6px; }
 #end .end-rating-group .end-rating { min-width: 23px; }
}
@media(max-height:540px) and (orientation:landscape) {
 #menu .showcase { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); grid-template-rows: minmax(0,1fr) auto auto; gap: 5px; }
 #menu .hero-identity { gap: 4px; }
 #menu .hero-identity h2 { font-size: 23px; }
 #menu .hero-identity .ht { font-size: 9px; line-height: 1.2; }
 #menu .hero-identity .hcd { display: none; }
 #menu .hero-identity .hclr { gap: 2px; flex-wrap: wrap; }
 #menu .hero-identity .hbars { font-size: 8px; gap: 2px 4px; }
 #menu .hero-identity .hbars i { height: 3px; }
 #menu .hero-kit { gap: 3px; padding-top: 3px; }
 #menu .hero-kit .hskill-head { font-size: 10px; }
 #menu .hero-kit ul { gap: 3px 5px; }
 #menu .hero-kit li { grid-template-columns: 18px minmax(0,1fr); gap: 4px; padding: 1px 0; font-size: 10px; line-height: 1.2; }
 #menu .hero-kit li img,#menu .hero-kit li.pas::before { width: 18px; height: 18px; font-size: 14px; }
 #menu .hmore { min-height: 24px; }
 #menu .play-emblem { width: 18px; height: 18px; left: 8px; }
 #menu .qp b { padding-left: 20px; }
 #menu .playp .miss { padding-top: 3px; }
 #end .end-rating-group>.end-mvp { width: 13px; height: 15px; font-size: 5.5px; }
 #end .end-rating-group .end-rating { font-size: 13px; line-height: 1.05; }
 #feed>div:nth-last-child(n+3) { display: none; }
}

/* Designer 3 production assets: 48px insets, with square artwork kept uniform. */
:root { --aomui-slice: 48; --aomui-border-width: 12px; }
#end .end-team h2 { position: relative; }
#end[data-ui-results-ornament] .end-team h2>span { padding-left: 24px; }
#end[data-ui-results-ornament] .end-team h2::before { content: ''; position: absolute; width: 22px; height: 22px; left: 7px; top: 50%; transform: translateY(-50%); background: var(--aomui-results-ornament) center / contain no-repeat; pointer-events: none; }
#end .end-team { position: relative; }
#end .end-player { grid-template-columns: 34px minmax(0,1fr) 76px 72px; }
#end .end-cols { grid-template-columns: minmax(0,1fr) 76px 72px; }
#end .end-rating-group { position: relative; grid-column: 4; grid-row: 1/3; justify-content: flex-end; align-self: stretch; }
#end .end-rating-group>.end-mvp { width: 28px; height: 28px; font-size: 7px; align-items: end; padding-bottom: 2px; box-sizing: border-box; text-shadow: 0 1px 2px #000,0 0 3px #000; }
#end .end-rating-group>.end-rating { display: grid; place-items: center; width: 36px; height: 24px; flex: none; min-width: 0; background-size: contain; }
#end .end-items { grid-column: 2; grid-row: 2; }
#end .end-gold { grid-column: 3; grid-row: 2; line-height: 1.15; }
#end .end-gold small { display: inline; }
#end[data-ui-mvp] .end-mvp[data-award=win], #end[data-ui-mvp-team] .end-mvp[data-award=team] { font-size: 7px; }
#endTitle::before { inset: 0; }
#end .end-reward { color: #e9d6ad; }
#menu .showcase { background-image: radial-gradient(ellipse at 75% 40%, #36545a44, transparent 65%),linear-gradient(150deg,#152732,#061018); background-size: 100% 100%; }
#menu .showcase .hleft { position: relative; isolation: isolate; }
#menu .showcase .hleft::before,#menu .showcase .hleft::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1; background: var(--aomui-hero,none) center / contain no-repeat; }
#menu .showcase .hleft::after { background-image: var(--aomui-pedestal,none); background-position: center bottom; }
#menu #showCv { position: relative; z-index: 0; }
#menu #wkCard { background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #101a27; }
#menu #wkCard .wx { text-shadow: 0 1px 3px #000,0 0 4px #000; }
#topRow[data-ui-boss] #bossT { background-image: var(--aomui-boss); background-size: calc(16px / var(--uib,1)) calc(16px / var(--uib,1)); background-position: calc(5px / var(--uib,1)) center; padding-left: calc(23px / var(--uib,1)); }
#topRow[data-ui-boss] #bossT svg { display: none; }
#topRow[data-ui-event] #evPill::before { width: calc(16px / var(--uib,1)); height: calc(16px / var(--uib,1)); }
#feed[data-ui-kill]>div::before { width: calc(16px / var(--ui,1)); height: calc(16px / var(--ui,1)); }
@media(max-width:1050px) {
 #end .end-player { grid-template-columns: 28px minmax(0,1fr) 64px 62px; }
 #end .end-cols { grid-template-columns: minmax(0,1fr) 68px 62px; }
 #end .end-rating-group>.end-mvp { width: 24px; height: 24px; font-size: 6px; }
 #end .end-rating-group>.end-rating { width: 33px; height: 22px; }
}
@media(max-height:540px) {
 #end .end-rating-group>.end-mvp { width: 24px; height: 24px; font-size: 6px; }
 #end[data-ui-mvp] .end-mvp[data-award=win], #end[data-ui-mvp-team] .end-mvp[data-award=team] { font-size: 6px; }
 #end[data-ui-results-ornament] .end-team h2::before { width: 16px; height: 16px; }
 #end[data-ui-results-ornament] .end-team h2>span { padding-left: 16px; }
}

/* Keep live result text above the decorative plate. The original clipped text
   background put the opaque pseudo-element over the glyphs in screenshots. */
#end .end #endTitle { background: var(--aomui-victory,none) center / contain no-repeat; background-clip: border-box; -webkit-background-clip: border-box; color: #fff0bb; text-shadow: 0 2px 2px #000,0 0 5px #000; padding-inline: 44px; }
#end .end #endTitle.lose { background-image: var(--aomui-defeat,none); color: #ffe0e5; }
#end .end #endTitle.draw { background-image: none; color: #e8f4ff; }
#end #endTitle::before { display: none; }
/* Weekly art stays behind a quiet text surface, never across the live labels. */
#menu #wkCard { position: relative; isolation: isolate; background-image: linear-gradient(105deg,#27375b80,#7e663422); }
#menu #wkCard::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--aomui-weekly,none) center / contain no-repeat; opacity: .25; pointer-events: none; }
#menu #wkCard .wx { background: #0b1525d9; border-radius: 3px; padding: 1px 3px; }

/* A decorative rail must occupy a real border, not paint over the content box.
   Source slices are 48px; a fixed CSS border preserves the corner proportions.
   Remove the legacy inset outline and clip the fill inside the rails. */
#end[data-ui-frame] .end,
#end[data-ui-frame] .end-team,
#menu[data-ui-frame] .showcase,
#menu[data-ui-frame] .playp {
  box-sizing: border-box;
  border: 12px solid transparent;
  border-image-source: var(--aomui-frame);
  border-image-slice: 48;
  border-image-width: 1;
  border-image-outset: 0;
  border-image-repeat: stretch;
  border-radius: 0;
  background-clip: padding-box;
  box-shadow: none;
  clip-path: none;
}
#end[data-ui-frame-red] .end-team.enemy { border-image-source: var(--aomui-frame-red); }
#end[data-ui-frame] .end { padding: 6px; }
#end[data-ui-frame] .end-team { padding: 0 0 3px; }
#menu[data-ui-frame] .homegrid>.showcase,
#menu[data-ui-frame] .homegrid>.playp { padding: 4px; }
/* A single frame surrounds each team. Layering a second ornate bar and square
   crest over it produced tangled corners; the team banner uses its colour. */
#end[data-ui-frame] .end-team h2 { background-image: linear-gradient(90deg,#224b6fdd,#15364e55); border-bottom: 1px solid #b39b5b55; }
#end[data-ui-frame] .end-team.enemy h2 { background-image: linear-gradient(90deg,#602b3add,#361a2655); }
#end[data-ui-results-ornament] .end-team h2::before { display: none; }
#end[data-ui-results-ornament] .end-team h2>span { padding-left: 0; }
/* Level badges stay inside the portrait; the last items get a breathing gap. */
#end .end-portrait>small { bottom: 0; right: 0; }
#end[data-ui-frame] .end-player:last-child { padding-bottom: 6px; }
@media(max-height:500px) {
 #end[data-ui-frame] .end,
 #end[data-ui-frame] .end-team,
 #menu[data-ui-frame] .showcase,
 #menu[data-ui-frame] .playp { border-width: 8px; }
 #end[data-ui-frame] .end { padding: 0 4px; gap: 3px; }
 #end[data-ui-frame] .end #endTitle { font-size: 26px; }
 #menu[data-ui-frame] .homegrid>.showcase,
 #menu[data-ui-frame] .homegrid>.playp { padding: 3px; }
}
@media(max-height:500px) and (orientation:landscape) {
 /* Border space must not force a long hero name into two tall lines. */
 #menu .hero-identity { gap: 2px; }
 #menu .hero-identity h2 { font-size: 19px; line-height: 1.1; white-space: nowrap; }
 #menu .hero-identity .ht { font-size: 8px; }
 #menu .hero-identity .hbars { line-height: 1.1; }
}

/* Canvas stays full-bleed. Each overlay owns its safe padding exactly once;
   undo overlay zoom on the inset component, while the ordinary gap may scale. */
#menu.home { padding: calc(8px + var(--sat)/var(--mz,1)) calc(12px + var(--sar)/var(--mz,1)) calc(8px + var(--sab)/var(--mz,1)) calc(12px + var(--sal)/var(--mz,1)); }
#end { padding: calc(10px + var(--sat)/var(--mz,1)) calc(12px + var(--sar)/var(--mz,1)) calc(10px + var(--sab)/var(--mz,1)) calc(12px + var(--sal)/var(--mz,1)); }
/* Use Designer's existing winner/loser art; hierarchy follows the award, not
   the left/right team column. A draw has two equally quiet team awards. */
#end .end-player { grid-template-columns: 34px minmax(0,1fr) 76px 80px; }
#end .end-cols { grid-template-columns: minmax(0,1fr) 76px 80px; }
#end .end-rating-group>.end-mvp[data-award=win] { width: 36px; height: 36px; filter: drop-shadow(0 0 3px #ffc96388); opacity: 1; }
#end .end-rating-group>.end-mvp[data-award=team],
#end .end-rating-group>.end-mvp[data-award=draw] { width: 20px; height: 20px; filter: saturate(.35); opacity: .65; }
#end .end-mvp[data-award=draw] { background-image: var(--aomui-mvp-team,none); }
#end[data-ui-mvp-team] .end-mvp[data-award=draw] { background-color: transparent; clip-path: none; box-shadow: none; font-size: 6px; }
@media(max-width:1050px) {
 #end .end-player { grid-template-columns: 28px minmax(0,1fr) 64px 68px; }
 #end .end-cols { grid-template-columns: minmax(0,1fr) 68px 68px; }
 #end .end-rating-group>.end-mvp[data-award=win] { width: 32px; height: 32px; }
 #end .end-rating-group>.end-mvp[data-award=team],
 #end .end-rating-group>.end-mvp[data-award=draw] { width: 18px; height: 18px; }
}
@media(max-height:500px) and (orientation:landscape) {
 #end[data-ui-frame] .end-player { padding-top: 1px; padding-bottom: 1px; }
 #end[data-ui-frame] .end-player:last-child { padding-bottom: 4px; }
 #end[data-ui-frame] .end #endTitle { font-size: 24px; }
}
@media(max-height:500px) and (orientation:landscape) {
 #end .end-name { line-height: 1.05; }
 #end .end-name>b { line-height: 1.05; }
 #end .end-team h2 { line-height: 1.25; }
 #end .end-cols { padding-top: 2px; padding-bottom: 2px; }
 #end[data-ui-frame] .end #endTitle { font-size: 22px; }
}
@media(max-width:1050px) {
 /* Gold is hidden here, so its row space keeps all six item icons full-size. */
 #end .end-items { grid-column: 2/4; }
}
@media(max-height:400px) and (orientation:landscape) {
 #end[data-ui-frame] .end { gap: 2px; }
 #end .eyebrow { line-height: 1.2; }
}
@media(max-width:700px) and (max-height:400px) and (orientation:landscape) {
 /* The optional epithet yields room to name, class, stats and the full skill kit. */
 #menu .hero-identity .ht { display: none; }
 #menu .hero-identity h2 { font-size: 17px; }
}
@media(max-width:1050px) and (max-height:500px) and (orientation:landscape) {
 /* Safe-area height still leaves a readable mission row inside its scroller. */
 #menu .qp b { line-height: 1.2; }
 #menu .pb b { line-height: 1.2; }
 #menu .opts button { line-height: 1.2; }
}
@media(max-width:1050px) and (max-height:500px) and (orientation:landscape) {
 #menu .playp { grid-template-rows: 30px auto auto auto minmax(0,1fr); gap: 4px; }
 #menu .opts .poschip, #menu .opts .tutb { padding: 2px 4px; font-size: 10px; }
}

/* Portrait lobby (360-430px, th/en/vi/id): rows grow with their content, long labels wrap, nothing overlaps; no page scroll. */
@media(orientation:portrait) and (max-width:620px) {
 #menu.home { gap: 4px; }
 #menu .homegrid { grid-template-rows: max-content max-content minmax(112px,1fr); gap: 4px; }
 #menu .homegrid>section { padding: 6px 8px; }
 #menu .showcase { grid-template-rows: max-content max-content max-content; gap: 4px; }
 #menu .hero-identity .ht { letter-spacing: 0; line-height: 1.2; white-space: normal; }
 #menu .hero-identity .hclr { flex-wrap: nowrap; gap: 3px; }
 #menu .hero-identity .hclr>* { min-width: 0; padding-left: 6px; padding-right: 6px; font-size: 11px; white-space: nowrap; }
 #menu .showcase .hleft { position: relative; height: auto; min-height: 0; }
 #menu #showCv { max-height: 112px; }
 #menu .showcase .hleft>.hnb { position: absolute; top: auto; left: auto; right: 2px; bottom: 2px; max-width: calc(100% - 4px); padding: 2px 6px; font-size: 9px; line-height: 1.2; white-space: normal; text-align: center; }
 #menu .hero-identity { align-content: start; gap: 4px; }
 #menu .hero-identity h2 { font-size: 24px; }
 #menu .hero-identity .hbars { font-size: 9px; gap: 2px 6px; }
 #menu .hero-identity .hbars>* { min-width: 0; overflow-wrap: anywhere; }
 #menu .hero-kit { gap: 3px; padding-top: 4px; }
 #menu .hero-kit li.pas { grid-template-columns: 22px minmax(0,1fr); }
 #menu .hero-kit li { font-size: 10.5px; padding: 0; grid-template-columns: 22px minmax(0,1fr); }
 #menu .hero-kit li img, #menu .hero-kit li.pas::before { width: 22px; height: 22px; font-size: 16px; }
 #menu .playp { grid-template-columns: minmax(0,1fr) minmax(0,1.9fr); grid-template-rows: max-content max-content max-content minmax(56px,1fr); gap: 4px; }
 #menu .qp { height: auto; min-height: 44px; display: grid; place-items: center; padding: 4px 6px; }
 #menu .qp b, #menu .pb b { padding-left: 0; font-size: 13px; line-height: 1.15; white-space: normal; overflow: visible; text-overflow: clip; text-align: center; overflow-wrap: anywhere; }
 #menu .pb b { font-size: 10.5px; }
 #menu .play-emblem { display: none; }
 #menu .pbtns { align-items: stretch; }
 #menu #wkCard { padding: 3px 9px; }
 #menu #wkCard .wn { font-size: 10px; line-height: 1.15; }
 #menu #wkCard .wn b { font-size: 12px; }
 #menu .qp { overflow: hidden; }
 #menu #wkCard .wt, #menu #wkCard .wr { display: none; }
 #menu #wkCard .wd { display: inline; margin-right: 6px; font-size: 10.5px; }
 #menu .opts { flex-wrap: wrap; row-gap: 2px; }
 #menu .chatp { padding-top: 4px; padding-bottom: 4px; gap: 3px; }
 #menu .playp .miss { min-height: 56px; }
 #menu .playp .miss>h3 { display: block; margin: 0; font-size: 12px; white-space: normal; }
 #menu .chatp .clog { min-height: 30px; overflow-y: auto; }
 #menu .chatp .clog>* { overflow-wrap: anywhere; }
}
/* Very short portrait windows (<=720px high) cannot hold every panel: the lobby may scroll there instead of clipping. */
@media(orientation:portrait) and (max-width:620px) and (max-height:720px) {
 #menu.home { overflow-y: auto; }
 #menu .homegrid { flex: none; grid-template-rows: max-content max-content max-content; }
 #menu .chatp { min-height: 150px; }
}

/* Roster hero card: the free-week/lock label wraps at spaces (never mid-word) inside its own card. */
#menu .roster .hc .lk { z-index: 2; font-size: 8px; padding: 1px 3px; width: max-content; max-width: calc(100% - 2px); box-sizing: border-box; white-space: normal; text-align: center; line-height: 1.05; overflow-wrap: normal; word-break: normal; }
@media(max-height:500px) and (orientation:landscape) { #menu .roster .hc .lk { bottom: 16px; } }

/* Lobby launch buttons (all viewports): labels wrap at spaces instead of ending in an ellipsis; the sub-line clears the play emblem. */
#menu .pb b, #menu .pb small { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; line-height: 1.2; }
#menu .qp { overflow: hidden; }
#menu .qp::after { left: 0; width: 100%; background: linear-gradient(100deg,transparent,rgba(255,255,255,.55),transparent) no-repeat; background-size: 40% 100%; background-position: -100% 0; animation: aomqpshine 3.2s ease-in-out infinite; }
@keyframes aomqpshine { 0%,60% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
#menu .qp small { white-space: normal; overflow: visible; text-overflow: clip; padding-left: 28px; line-height: 1.25; }
/* Tablet portrait: the weekly-mode card drops its long description (as on short screens) so the mission line keeps its room. */
@media(orientation:portrait) and (min-width:621px) and (max-width:1050px) {
 #menu #wkCard .wt, #menu #wkCard .wr { display: none; }
 #menu #wkCard .wd { display: inline; margin-right: 6px; }
}
/* Short desktop windows (<=800px high): same weekly-card compaction so the mission line is not cut after the buttons wrap. */
@media(min-width:621px) and (max-height:800px) {
 #menu #wkCard .wt, #menu #wkCard .wr { display: none; }
 #menu #wkCard .wd { display: inline; margin-right: 6px; }
}

/* Tablet portrait header (621-900px): the logo no longer sits on the avatar and the wallet chips wrap inside the screen. */
@media(orientation:portrait) and (min-width:621px) and (max-width:900px) {
 #menu .topbar { flex-wrap: wrap; row-gap: 6px; }
 #menu .topbar .logo { display: none; }
 #menu .topbar .wallet { flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; max-width: 100%; }
}

/* Landscape HUD labels: keep Q clear of Heal/Minions and key badges off names. */
@media (orientation: landscape) and (max-height: 540px) {
 .pad .btn.s0 .nm { left: auto; right: -3px; transform: none; max-width: 120px; font-size: 9px !important; padding: 0 4px; }
 .pad .btn.btow .key { top: 50%; right: -6px; bottom: auto; left: auto; transform: translateY(-50%); }
 .pad #bAtk .key { top: 50%; right: -8px; bottom: auto; left: auto; transform: translateY(-50%); }
 #ctrl #bHeal .nm, #ctrl #bRecall .nm { font-size: 10px !important; padding: 0 5px; }
}

/* Queue #6 (ingame-modals-css): in-game windows (shop, scoreboard, settings). Spec: ux/ingame-modals-audit-20261121/FINAL-CSS-SPEC-TH.md ("ฉบับสุดท้ายรวมสำหรับ Q6" + ERRATUM 2 and 3: A1 A2 A3, group B removed).
   No graphics options, no prices/economy, nothing from the HUD R3 labels (#ctrl .btn .nm/.key), nothing in the lobby layout. */
/* 1+2) widths include padding (.shop was 663px at 667, .sbp 846px at 844); notch-safe width for the shop */
.shop, .sbp { box-sizing: border-box; }
.shop { max-width: calc(100vw - 32px - 2 * max(var(--sal, 0px), var(--sar, 0px))); }
/* sticky shop header at EVERY screen height (A3: at 1280x720 the long item list also scrolls the close button out of the frame). .shop is a flex column so the header's containing block is the whole scrolling content;
   top:-14px cancels the 14px padding of the scroller (A1: sticky is measured from the content edge, top:0 left a 14px strip above the header) */
.shop { display: flex; flex-direction: column; }
.shop > * { flex: none; }
.shop header { position: sticky; top: -14px; z-index: 2; margin: -14px -14px 0; padding: 14px 14px 8px; background: rgb(17,35,43); }
/* scoreboard on landscape phones: border-box made .sbp 18px narrower; ERRATUM 3+4 / A2 gives back ~26px per row (horizontal padding 4px, row gap 4px, a slimmer AI tag) so the name column and the AI tag keep their width. The AI tag is kept whole by the scoreboard block at the end of this file (the name lives in .nn, which carries the ellipsis) */
@media (max-height: 430px) {
 .sbp { padding-left: 4px; padding-right: 4px; }
 .sbr { padding-left: 4px; padding-right: 4px; gap: 4px; }
 .sbr .ai { padding: 0 2px; margin-left: 3px; }
}
/* 3A) 44px touch targets (pointer: coarse): the .cats hit area is the padding box +-7px (A2: 31px + 14px = 45px, 6px beyond the border edge) and wrapped rows are 12px apart, so the hit areas of two rows never overlap */
.cats { row-gap: 12px; }
@media (pointer: coarse) {
 .shop .xbtn, .sbx, .sndset .sx, .cats button { position: relative; }
 .shop .xbtn::after, .sbx::after, .sndset .sx::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
 .cats button::after { content: ''; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }
 /* the scoreboard's close button sits on the panel's right edge: keep its 44px target inside the 4px side padding */
 .sbx::after { left: auto; right: -4px; transform: translateY(-50%); }
}

/* Queue #6 narrow windows: UX ERRATUM 6. */
@media (max-width: 420px) {
  /* narrow windows: keep the content as wide as before border-box (outer margin 4px, padding 12px => 328px of content at 360) */
  .shop { width: calc(100vw - 8px); max-width: calc(100vw - 8px - 2 * max(var(--sal, 0px), var(--sar, 0px))); padding-left: 12px; padding-right: 12px; }
  .shop header { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  /* scoreboard rows: fit 360px (ERRATUM 5) */
  .sbr { grid-template-columns: 28px minmax(0,1fr) auto auto 40px; gap: 4px; padding-left: 4px; padding-right: 4px; }
  .sbr .cs { display: none; }
  .sbr .its span { width: 16px; height: 16px; }
  .sbr .pt, .sbr .pt canvas { width: 26px; height: 26px; }
  .sbp { padding-left: 4px; padding-right: 4px; }
}

/* Scoreboard AI tag (UX spec r2, 27 Nov): F1 name and tag are separate, F2 narrow name column, B two teams side by side on 660-760 landscape. Order matters. */
/* F1: only the name shrinks / ellipsizes; the AI tag never does */
.sbr .nm b{display:flex;align-items:baseline;min-width:0}
.sbr .nm .nn{flex:0 1 auto;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:1.35}
.sbr .ai{flex:0 0 auto}
.sbr .nm small{display:block;overflow:hidden;text-overflow:ellipsis}

/* F2a: compact row metrics where the name column starves */
@media (min-width:420.02px) and (max-width:540px), (min-width:760.02px) and (max-width:1000.98px){
  .sbp{padding-left:4px;padding-right:4px}
  .sbr{grid-template-columns:28px minmax(0,1fr) 56px 28px auto 46px;gap:4px;padding-left:4px;padding-right:4px}
  .sbr .pt,.sbr .pt canvas{width:26px;height:26px}
  .sbr .ai{padding:0 2px;margin-left:3px}
}
/* F2b: six items as 3 x 2 */
@media (max-width:540px), (min-width:760.02px) and (max-width:1000.98px){
  .sbr .its{display:grid;grid-template-columns:repeat(3,auto);justify-content:start;gap:2px}
  .sbr .its span{width:16px;height:16px}
}
@media (max-width:540px) and (max-height:430px), (min-width:760.02px) and (max-width:1000.98px) and (max-height:430px){
  .sbr .its span{width:14px;height:14px}
}
/* B: landscape 660-760 keeps both teams side by side */
@media (min-width:660px) and (max-width:760px) and (orientation:landscape){
  .sbg{grid-template-columns:1fr 1fr}
  .sbp{padding-left:4px;padding-right:4px}
  .sbr{grid-template-columns:28px minmax(0,1fr) 56px 24px auto 46px;gap:4px;padding-left:4px;padding-right:4px}
  .sbr .pt,.sbr .pt canvas{width:26px;height:26px}
  .sbr .ai{padding:0 2px;margin-left:3px}
  .sbr .its{display:grid;grid-template-columns:repeat(3,auto);justify-content:start;gap:2px}
  .sbr .its span{width:16px;height:16px}
}
@media (min-width:660px) and (max-width:760px) and (orientation:landscape) and (max-height:430px){
  .sbr{grid-template-columns:28px minmax(0,1fr) 56px 28px auto 46px}
  .sbr .its span{width:14px;height:14px}
}
