/* Straight vitality ribbon travels and fades with its ability dock. */
.academy-player-health{position:absolute;left:0;right:0;bottom:calc(100% + 15px);height:20px;border:1px solid #dfc18b;border-bottom:3px solid #795738;border-radius:3px;background:#21172e;box-shadow:0 0 0 3px #271d35,inset 0 0 0 1px #e5c98d33;overflow:hidden;pointer-events:none}
.academy-player-health i,.academy-team-health i{display:block;height:100%;width:100%;background:linear-gradient(#edadae,#c75774 50%,#913955);transition:width .1s linear}
.academy-player-health span{position:absolute;inset:0;display:grid;place-items:center;font:700 11px Georgia;color:#fff4da;text-shadow:0 1px 3px #100819,0 0 3px #100819}
.academy-player-health.critical i{background:linear-gradient(#ffb58a,#d34559)}
.academy-player-health[hidden],#academy-team-hud[hidden]{display:none!important}
#academy-team-hud{position:fixed;inset:48px 12px auto;z-index:9;display:flex;justify-content:space-between;gap:100px;pointer-events:none;color:#f4dfb1}
.academy-team-side{width:210px;max-width:calc((100vw - 130px)/2);display:flex;flex-direction:column;gap:5px}
.academy-team-side h3{font:700 9px Georgia;letter-spacing:.13em;margin:0 4px;color:#ddc390}.academy-team-side.enemies h3{text-align:right}
.academy-team-member{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 7px;padding:6px 8px;border:1px solid #b49a68;border-bottom:3px solid #665039;border-radius:9px 3px;background:linear-gradient(120deg,#392b47ed,#211a32eb);box-shadow:inset 0 0 0 2px #d1b98616}
.academy-team-name{grid-column:1/-1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 11px Georgia;color:#f6e4bf}
.academy-team-health{height:12px;position:relative;align-self:center;border:1px solid #b49a6877;background:#171222;border-radius:2px;overflow:hidden;min-width:0}
.academy-team-health span{position:absolute;inset:0;display:grid;place-items:center;font:700 8px Georgia;color:#fff9e8;text-shadow:0 1px 2px #000}
.allies .academy-team-health i{background:linear-gradient(#a7e6da,#447f89)}.enemies .academy-team-health i{background:linear-gradient(#e99aac,#954a71)}
.academy-team-spells{display:flex;gap:3px}.academy-team-spell{width:19px;height:19px;display:grid;place-items:center;border:1px solid #a88d6155;border-radius:3px;background:#1a1429;color:#b8a1c8;position:relative}
.academy-team-spell :is(img,svg){width:100%;height:100%;object-fit:contain}.academy-team-spell.active{border-color:#ffe6a1;box-shadow:0 0 0 1px #eccc86,0 0 8px #edcd8877;background:#765741}.academy-team-member.eliminated{opacity:.45}.academy-team-member.eliminated .academy-team-spells{filter:grayscale(1)}
@media(max-height:500px),(max-width:760px){#academy-team-hud{top:42px;left:8px;right:8px;gap:90px}.academy-team-side{width:170px;gap:3px}.academy-team-member{padding:3px 5px;gap:2px 4px}.academy-team-name{font-size:9px}.academy-team-spell{width:16px;height:16px}.academy-team-spells{gap:2px}.academy-team-health{height:10px}.academy-team-side h3{font-size:8px}.academy-player-health{height:16px;bottom:calc(100% + 12px)}.academy-player-health span{font-size:10px}}
body.touch-device:where([data-team-hud]):not(#_t):not(._t) #mobile-arena-map{top:auto!important;bottom:110px!important}
@media(prefers-reduced-motion:reduce){.academy-player-health i,.academy-team-health i{transition:none}}

/* Phone landscape: central health stays independent of the fading aim controls. */
.phone-personal-health{display:none}
@media(max-width:1000px) and (max-height:500px){
 body.touch-device #touch-controls .touch-spells>.academy-player-health{display:none!important}
 body.touch-device #touch-controls>.phone-personal-health:not([hidden]){display:block;position:fixed;left:50%;right:auto;top:auto;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);width:clamp(150px,25vw,240px);height:18px;z-index:66}
 body.touch-device:where([data-overlay-hidden]):not(#_ov):not(._ov):where([data-team-hud]):not(#_t):not(._t) #mobile-arena-map{left:var(--phone-map-left,8px)!important;top:var(--phone-map-top,112px)!important;bottom:auto!important;transform:none!important;width:92px!important;height:52px!important}
}

/* Tablets also use a central health strip, separate from either thumb area. */
@media(min-width:900px) and (min-height:600px){
 body.touch-device #touch-controls .touch-spells>.academy-player-health{display:none!important}
 body.touch-device #touch-controls>.phone-personal-health:not([hidden]){display:block;position:fixed;left:50%;right:auto;top:auto;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);width:220px;height:22px;z-index:66}
}

/* Combat banners: a freestanding crest, readable identity, and uninterrupted health. */
#academy-team-hud{inset:54px 18px auto;gap:130px}
#academy-team-hud .academy-team-side{width:clamp(340px,32vw,460px);max-width:calc((100vw - 166px)/2);gap:8px;--team-glow:#a9e5d4;--team-dark:#274948}
#academy-team-hud .enemies{--team-glow:#efabc5;--team-dark:#522e48}
#academy-team-hud .academy-team-side h3{font:800 11px/1.2 Georgia;letter-spacing:.18em;margin:0 12px 1px;color:var(--team-glow)}
#academy-team-hud .academy-team-member{grid-template-columns:78px minmax(0,1fr);grid-template-rows:26px 20px 28px 23px;gap:3px 13px;padding:12px 15px 10px;border:1px solid #b79a70;border-top:2px solid #edd6a1;border-bottom:4px solid #655037;border-radius:20px 6px 20px 6px;background:radial-gradient(ellipse at 0 0,var(--team-dark),transparent 65%),linear-gradient(130deg,#3d304cfa,#201a2bfa);box-shadow:inset 0 0 0 3px #1a142750,inset 0 5px 14px #e8d2aa09,0 5px 14px #0b071b55}
#academy-team-hud .academy-team-member::after{content:'';position:absolute;left:16px;right:16px;top:5px;height:1px;background:linear-gradient(90deg,transparent,#eeddb655,transparent);pointer-events:none}
#academy-team-hud .academy-team-rank{grid-column:1;grid-row:1/4;display:grid;place-items:center;filter:drop-shadow(0 4px 3px #0c0819);background:radial-gradient(ellipse,#dfd2b01a,transparent 70%)}
#academy-team-hud .academy-team-rank :is(img,svg){width:78px!important;height:78px!important;max-width:100%;object-fit:contain}
#academy-team-hud .academy-team-name{grid-column:2;grid-row:1;font:700 20px/26px Georgia;color:#fff0ce;text-shadow:0 2px 0 #100c19}
#academy-team-hud .academy-team-rating{grid-column:2;grid-row:2;font:800 15px/20px Georgia;color:var(--team-glow);letter-spacing:.03em}
#academy-team-hud .academy-team-spells{grid-column:2;grid-row:3;align-items:center;gap:5px}
#academy-team-hud .academy-team-spell{width:25px;height:25px;border-radius:6px;background:#161221;border-color:#c4a67b55}
#academy-team-hud .academy-team-health{grid-column:1/-1;grid-row:4;height:21px;border-radius:5px;border:1px solid #e5d3ac66;box-shadow:inset 0 2px 3px #0005}
#academy-team-hud .academy-team-health span{font:800 12px/20px Georgia;letter-spacing:.03em}
#academy-team-hud[data-team-size="2"] .academy-team-member,#academy-team-hud[data-team-size="3"] .academy-team-member{grid-template-columns:54px minmax(0,1fr);grid-template-rows:20px 17px 17px;padding:7px 11px;gap:2px 8px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-rank :is(img,svg){width:52px!important;height:52px!important}
#academy-team-hud:not([data-team-size="1"]) .academy-team-name{font-size:15px;line-height:20px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-rating{font-size:12px;line-height:17px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-health{grid-column:2;grid-row:3;height:15px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-health span{font-size:10px;line-height:14px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-spells{display:none}
@media(max-height:500px),(max-width:760px){#academy-team-hud{inset:42px 8px auto;gap:106px}#academy-team-hud .academy-team-side{width:300px;max-width:calc((100vw - 122px)/2);gap:4px}#academy-team-hud .academy-team-member{grid-template-columns:54px minmax(0,1fr);grid-template-rows:20px 16px 21px 18px;padding:7px 9px;gap:2px 8px;border-radius:14px 4px 14px 4px}#academy-team-hud .academy-team-rank :is(img,svg){width:54px!important;height:58px!important}#academy-team-hud .academy-team-name{font-size:16px;line-height:20px}#academy-team-hud .academy-team-rating{font-size:12px;line-height:16px}#academy-team-hud .academy-team-spell{width:19px;height:19px}#academy-team-hud .academy-team-health{height:17px}#academy-team-hud .academy-team-health span{font-size:10px;line-height:16px}#academy-team-hud .academy-team-side h3{font-size:9px}}

/* Modest increase over the original HUD, keeping rank and health easy to scan. */
#academy-team-hud .academy-team-side{width:250px;max-width:calc((100vw - 150px)/2);gap:5px}
#academy-team-hud .academy-team-member{grid-template-columns:42px minmax(0,1fr);grid-template-rows:17px 14px 18px 15px;padding:6px 8px;gap:2px 7px;border-radius:11px 4px 11px 4px;border-bottom-width:3px}
#academy-team-hud .academy-team-rank :is(img,svg){width:42px!important;height:46px!important}
#academy-team-hud .academy-team-name{font-size:13px;line-height:17px}
#academy-team-hud .academy-team-rating{font-size:10px;line-height:14px}
#academy-team-hud .academy-team-spell{width:17px;height:17px;border-radius:4px}
#academy-team-hud .academy-team-health{height:14px}
#academy-team-hud .academy-team-health span{font-size:9px;line-height:13px}
#academy-team-hud .academy-team-side h3{font-size:9px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-member{grid-template-columns:38px minmax(0,1fr);grid-template-rows:17px 14px 14px;padding:5px 7px;gap:1px 6px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-rank :is(img,svg){width:38px!important;height:42px!important}
#academy-team-hud:not([data-team-size="1"]) .academy-team-name{font-size:12px;line-height:17px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-rating{font-size:10px;line-height:14px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-health{height:13px}
@media(max-height:500px),(max-width:760px){#academy-team-hud .academy-team-side{width:200px;max-width:calc((100vw - 120px)/2)}#academy-team-hud .academy-team-member{grid-template-columns:34px minmax(0,1fr);grid-template-rows:15px 12px 16px 14px;padding:4px 6px;gap:1px 5px}#academy-team-hud .academy-team-rank :is(img,svg){width:34px!important;height:38px!important}#academy-team-hud .academy-team-name{font-size:11px;line-height:15px}#academy-team-hud .academy-team-rating{font-size:9px;line-height:12px}#academy-team-hud .academy-team-spell{width:15px;height:15px}#academy-team-hud .academy-team-health{height:13px}#academy-team-hud .academy-team-health span{font-size:8px;line-height:12px}}

/* Restore readable loadouts in every team size. */
#academy-team-hud .academy-team-member{grid-template-rows:17px 14px 29px 15px}
#academy-team-hud .academy-team-spells{display:flex!important;gap:5px;grid-column:2;grid-row:3}
#academy-team-hud .academy-team-spell{width:27px;height:27px;border-radius:5px;border-color:#e2c69399;box-shadow:inset 0 0 0 1px #100b1c;background:#100c1c;flex:none}
#academy-team-hud:not([data-team-size="1"]) .academy-team-member{grid-template-columns:38px minmax(0,1fr);grid-template-rows:17px 14px 25px 14px}
#academy-team-hud:not([data-team-size="1"]) .academy-team-health{grid-column:1/-1;grid-row:4}
#academy-team-hud:not([data-team-size="1"]) .academy-team-spell{width:23px;height:23px}
#academy-team-hud .academy-team-member{transition:opacity 140ms ease-out}
#academy-team-hud .academy-team-member.actor-under-card{opacity:.24}
@media(max-height:500px),(max-width:760px){#academy-team-hud .academy-team-member{grid-template-rows:15px 12px 24px 14px}#academy-team-hud .academy-team-spell{width:22px;height:22px}#academy-team-hud:not([data-team-size="1"]) .academy-team-member{grid-template-rows:15px 12px 22px 13px;padding:4px 6px}#academy-team-hud:not([data-team-size="1"]) .academy-team-spell{width:20px;height:20px}#academy-team-hud .academy-team-spells{gap:4px}}
@media(prefers-reduced-motion:reduce){#academy-team-hud .academy-team-member{transition:none}}

#academy-team-hud .academy-team-member[hidden],#academy-team-hud .academy-team-side[hidden]{display:none!important}

/* FFA uses individual standings instead of the team spell panels. */
.academy-ffa-board[hidden]{display:none!important}
.academy-ffa-board{position:absolute;z-index:16;left:12px;top:60px;width:clamp(155px,19vw,240px);box-sizing:border-box;padding:10px;border:1px solid #d5b879;border-radius:14px;background:linear-gradient(135deg,#382547f5,#161727f5);color:#f7ecd1;box-shadow:0 4px 12px #0005;pointer-events:none;font:12px system-ui}
.academy-ffa-heading{display:flex;justify-content:space-between;gap:8px;padding:0 3px 7px;color:#e8ce93;font-size:10px;letter-spacing:.07em}
.academy-ffa-row{display:grid;grid-template-columns:18px minmax(0,1fr) 24px;gap:6px;align-items:center;padding:5px 6px;margin:3px 0;border-radius:6px;background:#ffffff08}.academy-ffa-row.is-you{background:#9f78bb38;box-shadow:inset 2px 0 #e5cc88}.academy-ffa-row.is-dead{opacity:.65}.academy-ffa-row strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.academy-ffa-row small{display:block;color:#cbbbd9;font-size:10px;margin-top:2px}.academy-ffa-row b{text-align:right;font-size:17px;color:#ffe5a0}.academy-ffa-footer{font-size:9px;text-align:center;line-height:1.3;padding-top:7px;color:#d2c1df}
@media(max-height:500px){.academy-ffa-board{top:44px;left:7px;width:160px;padding:6px}.academy-ffa-row{padding:3px 5px;margin:2px 0}.academy-ffa-heading{padding-bottom:3px}.academy-ffa-footer{padding-top:3px;font-size:8px}}

@media(max-height:500px){.academy-ffa-board.ffa-many{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(280px,42vw);gap:2px 5px}.academy-ffa-board.ffa-many .academy-ffa-heading,.academy-ffa-board.ffa-many .academy-ffa-footer{grid-column:1/-1}.academy-ffa-board.ffa-many .academy-ffa-row{grid-template-columns:12px minmax(0,1fr) 15px;gap:3px;padding:2px 4px;margin:0;font-size:10px}.academy-ffa-board.ffa-many .academy-ffa-row small{font-size:8px}.academy-ffa-board.ffa-many .academy-ffa-row b{font-size:12px}}

/* Phone landscape (Daniel, 2026-10-16): PC-style corner columns instead of a
   full-width card row. Allies stack top-left, rivals top-right, so the timer,
   kill feed and "Eliminated by" banner keep the middle of the screen. */
@media(max-height:500px){
 html body #academy-team-hud#academy-team-hud{inset:6px max(6px,env(safe-area-inset-right)) auto max(6px,env(safe-area-inset-left))!important;gap:12px!important}
 html body #academy-team-hud#academy-team-hud .academy-team-side{display:flex!important;flex-direction:column;width:170px!important;max-width:calc((100vw - 260px)/2)!important;min-width:136px;gap:3px!important}
 html body #academy-team-hud#academy-team-hud .academy-team-side h3{font-size:8px!important;line-height:10px;margin:0 4px!important;letter-spacing:.14em}
 html body #academy-team-hud#academy-team-hud .academy-team-member{grid-row:auto;grid-template-columns:22px minmax(0,1fr) auto!important;grid-template-rows:14px 17px 10px!important;padding:3px 6px 4px!important;gap:2px 4px!important;border-radius:9px 3px 9px 3px!important;border-bottom-width:2px!important;min-width:0}
 html body #academy-team-hud#academy-team-hud .academy-team-rank{grid-column:1;grid-row:1/3}
 html body #academy-team-hud#academy-team-hud .academy-team-rank :is(img,svg){width:22px!important;height:26px!important}
 html body #academy-team-hud#academy-team-hud .academy-team-name{grid-column:2/-1!important;grid-row:1;font-size:11px!important;line-height:14px!important}
 html body #academy-team-hud#academy-team-hud .academy-team-spells{grid-column:2!important;grid-row:2!important;gap:2px!important;justify-content:flex-start}
 html body #academy-team-hud#academy-team-hud .academy-team-spell{width:17px!important;height:17px!important;border-radius:3px}
 html body #academy-team-hud#academy-team-hud .academy-team-spell b{font-size:10px}
 html body #academy-team-hud#academy-team-hud .academy-team-rating{grid-column:3;grid-row:2;align-self:center;font-size:8px!important;line-height:10px!important;white-space:nowrap;letter-spacing:0}
 html body #academy-team-hud#academy-team-hud .academy-team-health{grid-column:1/-1!important;grid-row:3!important;height:10px!important;border-radius:3px}
 html body #academy-team-hud#academy-team-hud .academy-team-health span{font-size:7.5px!important;line-height:9px!important}
 /* Four a side still clears the joystick: slimmer rows, health bar without numbers. */
 html body #academy-team-hud#academy-team-hud[data-team-size="4"] .academy-team-member{grid-template-rows:13px 15px 6px!important;padding:2px 6px 3px!important}
 html body #academy-team-hud#academy-team-hud[data-team-size="4"] .academy-team-spell{width:15px!important;height:15px!important}
 html body #academy-team-hud#academy-team-hud[data-team-size="4"] .academy-team-health{height:6px!important}
 html body #academy-team-hud#academy-team-hud[data-team-size="4"] .academy-team-health span{display:none}
 /* Hints such as "YOU ARE OUT" drop just below the minimap and stay one line. */
 html body #match#match #notice.notice#notice{top:74px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:max-content!important;max-width:calc(100vw - 2*(var(--hud-column,176px) + 20px))!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px!important;line-height:13px!important}
}
@media(max-height:500px) and (max-width:700px){
 html body #match{--hud-column:156px}
 html body #match#match #notice.notice#notice{font-size:9.5px!important;letter-spacing:-.01em}
 html body #academy-team-hud#academy-team-hud .academy-team-side{width:150px!important}
 html body #academy-team-hud#academy-team-hud .academy-team-rating{display:none}
 html body #academy-team-hud#academy-team-hud .academy-team-member{grid-template-columns:22px minmax(0,1fr)!important}
}
