/* ---- The BFME1 main menu (replica/bfme1/ui.md §3): the animated Mordor scene behind, the title top right in
   gold engraved capitals, the entries as dark red framed tabs with black knotwork in a band along the bottom.
   Phones (narrow portrait, short landscape) keep the scrolling column, in the same tab dress.
   The knotwork is our own SVG: two interlaced cords, broken where one passes under the other. ---- */
:root {
  --tab-red: #5b140e;
  --tab-red-deep: #2c0806;
  --tab-gold: #d9b06a;
  --knot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='8' viewBox='0 0 20 8'%3E%3Cg fill='none' stroke='%23080202' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 4C3 0 7 0 10 4'/%3E%3Cpath d='M10 4C13 8 17 8 20 4'/%3E%3Cpath d='M0 4C1.6 6 3 7 4.6 7.4M7.4 6.8C8.4 6.2 9.2 5.2 10 4'/%3E%3Cpath d='M10 4C11.6 2 13 1 14.6.6M17.4 1.2C18.4 1.8 19.2 2.8 20 4'/%3E%3C/g%3E%3Cg fill='none' stroke='%23b0824a' stroke-opacity='.35' stroke-width='.5'%3E%3Cpath d='M0 4C3 0 7 0 10 4M10 4C13 8 17 8 20 4'/%3E%3C/g%3E%3C/svg%3E");
}

/* The tab dress, everywhere (column and band). */
#menu .mbtn {
  position: relative;
  color: #f2dcae;
  background: linear-gradient(180deg, #74201a 0%, var(--tab-red) 30%, #3e0d09 72%, var(--tab-red-deep) 100%);
  border: 1px solid #120403;
  box-shadow: inset 0 0 0 1px rgba(217, 176, 106, .5), inset 0 0 0 4px rgba(10, 2, 2, .7), inset 0 0 0 5px rgba(217, 176, 106, .22), inset 0 12px 18px rgba(255, 170, 120, .06);
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .6);
}
#menu .mbtn::before, #menu .mbtn::after {
  content: ""; position: absolute; left: 7px; right: 7px; height: 8px; pointer-events: none;
  background: var(--knot) repeat-x center / 20px 8px; opacity: .95;
}
#menu .mbtn::before { top: 5px; }
#menu .mbtn::after { bottom: 5px; }
#menu .mbtn > .icon { color: var(--tab-gold); }
#menu .mbtn small { color: #d6b98a; }
#menu .mbtn:not(:disabled):hover { background: linear-gradient(180deg, #8f2a1f 0%, #6e1a12 34%, #4a110b 74%, #300906 100%); border-color: #120403; box-shadow: inset 0 0 0 1px rgba(240, 200, 120, .85), inset 0 0 0 4px rgba(10, 2, 2, .7), inset 0 0 0 5px rgba(240, 200, 120, .4), 0 0 16px rgba(255, 120, 40, .18); color: #fff0cc; }
#menu .mbtn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #f3cf86, inset 0 0 0 5px rgba(10, 2, 2, .7), 0 0 18px rgba(243, 207, 134, .35); }
#menu .mbtn.primary, #menu .menu-primary { color: #ffe7b0; background: linear-gradient(180deg, #8c2418 0%, #6a170f 30%, #470f0a 72%, #2e0805 100%); box-shadow: inset 0 0 0 1px rgba(240, 200, 120, .8), inset 0 0 0 4px rgba(10, 2, 2, .7), inset 0 0 0 5px rgba(240, 200, 120, .42), inset 0 12px 18px rgba(255, 190, 120, .08); }
#menu .mbtn.primary .icon, #menu .menu-primary .icon { color: #f6cf7c; }
#menu .mbtn.primary small, #menu .menu-primary small { color: #e8c88f; }
#menu .mbtn:disabled { opacity: .55; filter: saturate(.6); }
#menu .mbtn .button-end { color: rgba(217, 176, 106, .6); }

/* The title in gold engraved capitals (the band places it top right). */
#menu .menu-title { font-family: "Cinzel", serif; font-weight: 700; letter-spacing: .04em; text-shadow: none;
  color: #e9c27a; background: linear-gradient(180deg, #fff4d2 0%, #f1cf86 30%, #b9853a 52%, #e8c27a 70%, #7d531f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 236, 190, .25)) drop-shadow(0 -1px 0 rgba(0, 0, 0, .9)) drop-shadow(0 3px 2px rgba(0, 0, 0, .9)) drop-shadow(0 0 22px rgba(0, 0, 0, .55)); }
#menu .menu-title span { background: inherit; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
#menu .menu-title span:first-child { font-size: .62em; letter-spacing: .14em; color: inherit; }

/* Column (phones): the knot bands need the tab's top and bottom free. */
@media (max-width: 700px), (orientation: landscape) and (max-height: 540px) {
  #menu .menu-btns .mbtn, #menu .menu-saves .mbtn, #menu .menu-install .mbtn { padding-top: 12px; padding-bottom: 12px; }
}

/* ---- The band (desktop and tablets) ---- */
@media (min-width: 701px) and (min-height: 541px) {
  #menu { overflow: hidden; background: radial-gradient(ellipse 52% 46% at 88% 10%, rgba(12, 3, 2, .72), rgba(12, 3, 2, 0) 70%), linear-gradient(0deg, rgba(10, 2, 2, .55), rgba(10, 2, 2, 0) 34%); }
  /* An installed pack older than the game expects (PackAge.js): one line over the title, out of the layout's way. */
  #menu .pack-notice { position: absolute; z-index: 5; top: calc(18px + var(--safe-top)); left: 50%; transform: translateX(-50%); margin: 0; width: max-content; max-width: min(88vw, 640px); padding: 7px 14px; font-size: 12px; line-height: 1.35; text-align: center; color: #f3e3b7; background: rgba(58, 14, 10, .88); border: 1px solid rgba(214, 170, 90, .7); border-radius: 4px; }
  #menu .menu-frame { inset: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left)); }
  #menu .edition, #menu .atlas-mark, #menu .menu-foot { display: none; }
  #menu .menu-content { position: static; width: auto; margin: 0; padding: 0; }

  /* The title: top right, gold engraved serif. */
  #menu .menu-head { position: absolute; top: calc(clamp(44px, 8vh, 96px) + var(--safe-top)); right: calc(clamp(40px, 5.5vw, 104px) + var(--safe-right)); display: flex; flex-direction: column; align-items: flex-end; max-width: 52vw; text-align: right; }
  #menu .menu-head > .eyebrow { margin-bottom: 12px; color: #d9b06a; text-shadow: 0 1px 3px #000; }
  #menu .menu-title { align-items: flex-end; font-size: clamp(46px, min(6vw, 10vh), 104px); line-height: 1.02; }
  #menu .menu-head .title-rule { width: 180px; margin: 14px 0 10px; background: linear-gradient(270deg, #d9b06a, transparent); }
  #menu .menu-sub { font-family: "Cinzel", serif; font-style: normal; font-size: clamp(14px, 1.3vw, 18px); letter-spacing: .08em; color: #e3cfa6; text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .8); }

  /* The band: a dark strip with gold hairlines along the bottom, the tabs in one row (two on narrow tablets). */
  #menu .menu-band { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px;
    padding: 26px calc(28px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(28px + var(--safe-left));
    background: linear-gradient(0deg, rgba(12, 3, 2, .96) 0%, rgba(16, 4, 3, .9) 62%, rgba(16, 4, 3, 0) 100%); }
  #menu .menu-band::before { content: ""; position: absolute; left: calc(28px + var(--safe-left)); right: calc(28px + var(--safe-right)); top: 16px; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 176, 106, .7) 18%, rgba(217, 176, 106, .7) 82%, transparent); pointer-events: none; }
  #menu .menu-btns { flex: 0 0 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; width: auto; margin: 0; gap: 10px; }
  #menu .menu-btns .mbtn { flex: 0 1 178px; min-width: 132px; min-height: 58px; justify-content: center; gap: 0; padding: 16px 12px; text-align: center; font-family: "Cinzel", serif; font-size: 14.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%, 0 9px); }
  #menu .menu-btns .mbtn > .icon, #menu .menu-btns .button-end, #menu .menu-btns .arrow, #menu .menu-btns small { display: none; }
  #menu .menu-btns .menu-primary { flex-basis: 196px; min-height: 64px; font-size: 16px; }
  /* Back-up, install, offline and sound: one quiet line under the tabs. */
  #menu .menu-saves { width: auto; margin: 0; gap: 8px; }
  #menu .menu-saves .mbtn, #menu .menu-install .mbtn { min-height: 34px; padding: 6px 16px; font-size: 12px; letter-spacing: .07em; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%, 0 6px); }
  #menu .menu-saves .mbtn::before, #menu .menu-saves .mbtn::after, #menu .menu-install .mbtn::before, #menu .menu-install .mbtn::after { display: none; }
  #menu .menu-saves .icon, #menu .menu-install .icon { width: 15px; height: 15px; }
  #menu .menu-install { width: auto; margin: 0; }
  #menu .menu-install .mbtn small { display: inline; margin: 0 0 0 6px; font-size: 10.5px; }
  #menu .menu-offline { width: auto; max-width: 260px; margin: 0; text-align: left; font-size: 11px; }
  #menu .menu-offline small { font-size: 10px; }
  #menu .menu-extras { gap: 6px 18px; }
  #menu .menu-extras .sound-toggle { margin: 0; min-height: 34px; }
}
/* Short desktop windows: a slimmer band and title. */
@media (min-width: 701px) and (min-height: 541px) and (max-height: 760px) {
  #menu .menu-btns .mbtn { min-height: 50px; padding-top: 13px; padding-bottom: 13px; }
  #menu .menu-btns .menu-primary { min-height: 54px; }
  #menu .menu-band { padding-top: 20px; gap: 6px 14px; }
  #menu .menu-head { top: calc(36px + var(--safe-top)); }
}
/* Narrow tablets: two rows of three tabs. */
@media (min-width: 701px) and (max-width: 1080px) and (min-height: 541px) {
  #menu .menu-btns { max-width: 640px; margin: 0 auto; }
  #menu .menu-btns .mbtn, #menu .menu-btns .menu-primary { flex: 0 1 196px; }
  #menu .menu-head { max-width: 70vw; }
}
@media (prefers-reduced-motion: no-preference) {
  #menu.menu-reveal .menu-band { animation: band-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  #menu.menu-reveal .menu-head { animation: head-fade 1.1s ease-out both; }
}
@keyframes band-rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes head-fade { from { opacity: 0; filter: blur(3px); } }

/* ---- The battle loading panel (BattleLoad.js; ui.md §3): a red field with a ring of pseudo-script, a "Loading"
   plaque, and a dark panel in a thin gold frame with the map card, its atlas and the commanders' progress. ---- */
.battle-load { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden;
  padding: calc(20px + var(--safe-top)) calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
  background: radial-gradient(ellipse 70% 60% at 50% 48%, #7a1a0e 0%, #4a0d07 46%, #1c0403 100%); color: #f2dcae; transition: opacity .25s ease-out; }
.battle-load.bl-out { opacity: 0; pointer-events: none; }
.bl-ring { position: absolute; left: 50%; top: 48%; width: min(118vmin, 980px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; opacity: .4;
  background: repeating-conic-gradient(from 3deg, rgba(255, 170, 90, .55) 0 .7deg, transparent .7deg 1.3deg, rgba(255, 170, 90, .35) 1.3deg 1.6deg, transparent 1.6deg 2.9deg, rgba(255, 170, 90, .5) 2.9deg 3.3deg, transparent 3.3deg 4.4deg);
  -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 62.5% 66%, transparent 66.5% 69%, #000 69.5% 70%, transparent 70.5%); mask: radial-gradient(circle, transparent 0 62%, #000 62.5% 66%, transparent 66.5% 69%, #000 69.5% 70%, transparent 70.5%); }
.bl-plaque { position: relative; padding: 9px 46px 8px; font: 700 18px/1 "Cinzel", serif; letter-spacing: .3em; text-transform: uppercase; color: #ffe2a6; text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #6e1a12, #3a0b07); box-shadow: inset 0 0 0 1px rgba(217, 176, 106, .75), inset 0 0 0 4px rgba(10, 2, 2, .7), 0 4px 18px rgba(0, 0, 0, .5);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%); }
/* 1.06's loading card (footage 0:05): a dark-red panel in a thin gold frame, the map's name with its player count over a row of three boxes (the photo, the one-line
   description, the radar picture with the numbered starts), then the table Player Name / Level / Team / Army / Progress. */
.bl-panel { position: relative; display: flex; flex-direction: column; gap: 12px; width: min(820px, 100%); padding: 14px 18px 18px; background: linear-gradient(180deg, rgba(92, 24, 14, .96), rgba(58, 14, 9, .97));
  border: 1px solid rgba(217, 176, 106, .8); box-shadow: 0 0 0 4px rgba(12, 4, 3, .8), 0 0 0 5px rgba(217, 176, 106, .3), 0 18px 60px rgba(0, 0, 0, .6); }
.bl-name { margin: 0; text-align: center; font: 600 clamp(15px, 1.8vw, 19px)/1.2 var(--display, "Cinzel", serif); letter-spacing: .02em; color: #f6e9cf; }
.bl-top { display: grid; grid-template-columns: 148px 1fr 148px; gap: 14px; align-items: stretch; }
.bl-photo, .bl-map { padding: 4px; background: #2b1a0f; border: 1px solid #a47a3f; box-shadow: inset 0 0 0 1px #000, 0 0 0 2px rgba(18, 6, 4, .8); }
.bl-photo { display: flex; align-items: center; justify-content: center; height: 118px; align-self: center; }
.bl-photo img { display: block; width: 100%; height: 100%; object-fit: fill; }
.bl-photo img[hidden] { display: none; }
.bl-map canvas { display: block; width: 100%; aspect-ratio: 1; }
.bl-desc { margin: 0; padding: 10px 14px; display: flex; align-items: center; border: 1px solid rgba(217, 176, 106, .55); background: rgba(40, 8, 5, .55); color: #f3e6cb; font: 400 clamp(14px, 1.7vw, 18px)/1.35 var(--display, serif); }
.bl-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; border: 1px solid rgba(217, 176, 106, .5); background: rgba(40, 8, 5, .5); }
.bl-table th { padding: 5px 8px; font: 600 12px var(--display, serif); color: #d9b06a; border-bottom: 1px solid rgba(217, 176, 106, .45); background: rgba(110, 30, 18, .5); }
.bl-table td { padding: 6px 8px; vertical-align: middle; color: #f2e4c6; border-bottom: 1px solid rgba(217, 176, 106, .12); }
.bl-swatch { display: inline-block; width: 22px; height: 18px; vertical-align: middle; border: 1px solid #e9c98a; border-radius: 4px; box-shadow: 0 0 0 1px #000; }
.bl-table td:last-child { width: 30%; }
.bl-bar { display: block; height: 10px; background: #1a0b07; border: 1px solid #6b4a2a; box-shadow: inset 0 1px 3px #000; }
.bl-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #f6d48a, #c08a3a 60%, #8a5d22); transition: width .2s ease-out; }
@media (max-width: 620px) {
  .bl-panel { padding: 12px; gap: 10px; }
  .bl-top { grid-template-columns: 1fr 1fr; }
  .bl-desc { grid-column: 1 / -1; order: 3; justify-content: center; text-align: center; }
  .bl-photo { height: 100px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .battle-load { gap: 8px; }
  .bl-plaque { padding: 6px 32px 5px; font-size: 14px; }
  .bl-panel { padding: 8px 12px 10px; gap: 6px; }
  .bl-top { grid-template-columns: 112px 1fr 112px; gap: 10px; }
  .bl-photo { height: 88px; }
  .bl-desc { padding: 6px 10px; font-size: 13px; }
  .bl-table th, .bl-table td { padding: 3px 6px; }
}
/* "A new version is ready. Reload": a small bronze plaque with one tab button. */
#menu .menu-update .mbtn { width: auto; min-height: 32px; margin: 0; padding: 4px 16px; font-size: 12px; letter-spacing: .07em; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%, 0 6px); }
#menu .menu-update .mbtn::before, #menu .menu-update .mbtn::after { display: none; }

/* No BFME1 pack installed: the playable entries are locked until the import is done (main.js applyPackLock). */
#menu .mbtn.locked { opacity: .5; filter: saturate(.5); }
#menu .mbtn.locked small { color: #f3cf86; }

/* BFME1 cursors (src/game/ui/Cursors.js): every element but the battlefield canvas shows the cursor set on <html> */
html.bfme-cursors :not(canvas) { cursor: inherit !important; }
.text-link[hidden] { display: none; }

/* BFME's book opening over a menu screen (main.js bookOpen, AlphaVideo): a flourish, never in the way */
#bookWipe { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#bookWipe.hidden { display: none; }
#bookWipe canvas { width: min(100vw, 133vh); height: auto; aspect-ratio: 4 / 3; max-height: 100vh; }
#bookWipe.book-in { animation: book-wipe 1.5s ease-out both; }
@keyframes book-wipe { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---- BFME1's own art (body.bfme-skin, src/game/real/RealMenu.js): the bevelled tan and bronze plates for the tabs,
   cream-gold on hover, the compass star, the load page and the loading ring. Only while a pack is installed. ---- */
body.bfme-skin #menu .mbtn {
  background: var(--bf-buttonDarkB) 0 0 / 100% 100% no-repeat; border: 0; box-shadow: none; clip-path: none;
  color: #2b1606; text-shadow: 0 1px 0 rgba(255, 238, 196, .5);
}
body.bfme-skin #menu .mbtn::before, body.bfme-skin #menu .mbtn::after { display: none; }
body.bfme-skin #menu .mbtn.primary, body.bfme-skin #menu .menu-primary { background-image: var(--bf-buttonTan); color: #2b1606; text-shadow: 0 1px 0 rgba(255, 238, 196, .55); }
body.bfme-skin #menu .mbtn:not(:disabled):hover, body.bfme-skin #menu .mbtn:not(:disabled):focus-visible {
  background: var(--bf-buttonTan) 0 0 / 100% 100% no-repeat; color: #2b1606; text-shadow: 0 1px 0 rgba(255, 238, 196, .6); border: 0; box-shadow: 0 0 22px rgba(255, 196, 96, .45); filter: brightness(1.12);
}
body.bfme-skin #menu .mbtn .icon, body.bfme-skin #menu .mbtn small { color: inherit; }
body.bfme-skin #menu .mbtn:disabled, body.bfme-skin #menu .mbtn.locked { filter: grayscale(.7) brightness(.7); }
body.bfme-skin #menu .menu-saves .mbtn, body.bfme-skin #menu .menu-install .mbtn { color: #2b1606; text-shadow: 0 1px 0 rgba(255, 238, 196, .5); background-image: var(--bf-barTan); }
body.bfme-skin #menu .menu-head .title-rule { height: 21px; width: 91px; background: var(--bf-swirl) center / contain no-repeat; margin: 10px 0 6px; filter: invert(1) sepia(.6) saturate(2) brightness(1.1); }
body.bfme-skin #menu .menu-head .title-rule span { display: none; }
/* The pack's load page is a 1024 x 768 picture in a 1024 x 1024 texture (the last quarter is padding), stretched over the whole screen. Its black frame is 5.7% to 94.3% across and
   19.7% to 79.4% down, the ring under it at 91.8%: the card FILLS the frame, as 1.06's does (footage 0:05: the card, its photo, description and map and the table fill the frame
   whatever the screen), and everything in it is sized from the card (container units), so it is the same card on a desktop, an iPad and a phone. */
body.bfme-skin .battle-load { background: #000 var(--bf-loadPage) center top / 100% 133.333% no-repeat; padding: 0; }
body.bfme-skin .battle-load .bl-ring { display: none; }
/* With the pack's shell scenes the page's black frame is a hole over the red backdrop (BattleLoad._startBackdrop) */
.battle-load .bl-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
body.bfme-skin .battle-load.bl-scene { background: transparent; }
body.bfme-skin .battle-load.bl-scene::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--bl-page) center top / 100% 133.333% no-repeat; }
body.bfme-skin .battle-load.bl-scene > :not(.bl-backdrop) { z-index: 2; }
body.bfme-skin .bl-plaque { position: absolute; top: 3.2%; left: 50%; transform: translateX(-50%); font-size: clamp(12px, 3vh, 28px); letter-spacing: .03em; text-transform: none; padding: .45em 2.6em .4em; color: #f2c36f; }
/* Beta 12 item 10: 1.06's card is 70.7% of the picture across and 59.2% down at 14.7% / 22.2% (footage 0:05: 94 to 547 of 640, 80 to 293 of 360; the movie's 4:3 stage stretched over
   the screen, as the score screen is), inside the page's frame, with the map's name small over the three boxes, the photo, the description, left-aligned, in a larger size, and the
   radar picture, then the table (78% of the card, no cell borders). Everything is placed in percent of the card, so the boxes keep the stage's proportions on any screen. The words
   are mixed case (lotr's own strings), in the roman face the games' menus use (the movie's Albertus MT is not on this machine). */
body.bfme-skin .bl-panel { position: absolute; left: 14.7%; top: 22.2%; width: 70.7%; height: 59.2%; box-sizing: border-box; container-type: size; display: grid; grid-template-rows: 11.7% 29.6% 8.9% minmax(0, 1fr); gap: 0; background: linear-gradient(180deg, rgba(92, 24, 14, .8), rgba(58, 14, 9, .85));
  padding: 0; box-shadow: none; border: 1px solid rgba(217, 176, 106, .8); font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
body.bfme-skin .bl-name { align-self: center; font: 500 max(11px, 3.7cqh)/1.1 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; letter-spacing: .01em; }
body.bfme-skin .bl-top { position: relative; display: block; min-height: 0; }
body.bfme-skin .bl-photo, body.bfme-skin .bl-map { position: absolute; top: 0; height: 100%; min-height: 0; box-sizing: border-box; padding: 1.2cqh; }
body.bfme-skin .bl-photo { left: 4.6%; width: 17.9%; }
body.bfme-skin .bl-map { left: 77.3%; width: 18.3%; }
body.bfme-skin .bl-photo img { height: 100%; }
body.bfme-skin .bl-map canvas { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
body.bfme-skin .bl-desc { position: absolute; top: 0; left: 28%; width: 44.4%; height: 100%; box-sizing: border-box; align-items: flex-start; text-align: left; justify-content: flex-start; font: 400 max(11px, 4.5cqh)/1.3 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; padding: 2.2cqh 1.6cqw; min-height: 0; }
body.bfme-skin .bl-table { grid-row: 4; justify-self: center; width: 78%; align-self: start; border: 0; background: none; font: 400 max(9px, 3.5cqh)/1.25 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
body.bfme-skin .bl-table th { font: 400 max(9px, 3.5cqh)/1.25 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; padding: .6cqh 1cqw; background: none; color: #e8c585; border-bottom: 1px solid rgba(217, 176, 106, .5); }
body.bfme-skin .bl-table td { padding: .5cqh 1cqw; border-bottom: 0; }
body.bfme-skin .bl-bar { height: max(6px, 2cqh); }
body.bfme-skin .bl-level { display: inline-block; width: max(16px, 4.6cqh); height: max(16px, 4.6cqh); vertical-align: middle; background-size: 100% 100%; image-rendering: auto; }
body.bfme-skin .battle-load .bl-loadring { position: absolute; left: 50%; top: 91.8%; bottom: auto; transform: translate(-50%, -50%); margin: 0; width: 12.6vh; height: 12.6vh; }
.battle-load .bl-loadring { display: block; flex: none; width: 76px; height: 76px; margin: -6px 0; }
.battle-load .bl-loadring[hidden] { display: none; }

/* BFME1 front-end clips (src/game/ui/MenuClips.js): book flips share the book wipe; the flag wipe covers the whole page */
#bookWipe { overflow: hidden; --wipe-ms: 1.5s; }
#bookWipe.book-in { animation-duration: var(--wipe-ms); }
#bookWipe.flag-in canvas { width: max(100vw, 133.4vh); height: auto; max-height: none; aspect-ratio: 4 / 3; flex: none; }
#bookWipe.flag-in { animation: none; }
/* the faction picture (MovieSkirmish<Faction> on the setup screen, MovieOnlineHome<Faction> in the multiplayer lobby) */
.fclip { width: 112px; height: 112px; overflow: hidden; border: 2px solid #8a6b36; box-shadow: 0 0 0 1px #2b1606, 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 14px rgba(0, 0, 0, .5); background: #120c06; }
.fclip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.setup-heading { position: relative; }
.setup-heading .fclip { position: absolute; top: 0; right: 0; }
.fclip-inline { margin: 4px 0 12px; }
@media (max-width: 700px), (max-height: 540px) { .fclip { width: 76px; height: 76px; } }
/* the credits (Credits_with_alpha over the shell scene) */
#creditsWipe { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#creditsWipe.hidden { display: none; }
#creditsWipe canvas { width: min(100vw, 133.4vh); height: auto; aspect-ratio: 4 / 3; max-height: 100vh; }

/* Beta 13 item 6: the loading page is 1.06's LoadScreen movie (BattleLoad.js with the pack's ui/apt/loading.json): the title plaque, the card in its copper frame and the pattern bar are
   the movie's art on a canvas over the shell's red backdrop (no outer frame, no ring); the game's words and pictures sit where the movie marks them (stage units: --apt-sx / --apt-sy). */
body.bfme-skin .battle-load.bl-apt, .battle-load.bl-apt { display: block; padding: 0; background: #000; }
.battle-load.bl-apt .bl-host { position: absolute; inset: 0; z-index: 2; }
.battle-load.bl-apt .bl-host .apt-canvas { pointer-events: none; }
.battle-load.bl-apt .apt-item { pointer-events: none; }
.battle-load.bl-apt .bl-name { margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; font: 400 calc(var(--apt-sy) * 16)/1 var(--apt-font); letter-spacing: 0; color: #fff; }
.battle-load.bl-apt .bl-photo, .battle-load.bl-apt .bl-map { display: block; padding: 0; background: none; border: 0; box-shadow: none; height: auto; }
.battle-load.bl-apt .bl-photo img, .battle-load.bl-apt .bl-map canvas { display: block; width: 100%; height: 100%; object-fit: fill; aspect-ratio: auto; }
.battle-load.bl-apt .bl-desc { margin: 0; padding: calc(var(--apt-sy) * 2) calc(var(--apt-sx) * 4); display: block; border: 0; background: none; color: #fff; text-align: left; font: 400 calc(var(--apt-sy) * 15)/1.25 var(--apt-font); overflow: hidden; }
.battle-load.bl-apt .bl-tablebox { overflow: hidden; }
.battle-load.bl-apt .bl-table { height: auto; table-layout: fixed; width: 100%; border: 0; border-collapse: collapse; background: none; text-align: center; font: 400 calc(var(--apt-sy) * 14)/1 var(--apt-font); color: #fff; }
.battle-load.bl-apt .bl-table th { height: calc(var(--apt-sy) * 25); padding: 0; border: 0; background: none; font: 400 calc(var(--apt-sy) * 16)/1 var(--apt-font); color: #e99a44; }
.battle-load.bl-apt .bl-table td { height: calc(var(--apt-sy) * 21.7); padding: 0; border: 0; color: #fff; vertical-align: middle; white-space: nowrap; overflow: hidden; }
.battle-load.battle-load.bl-apt .bl-table th:nth-child(1) { width: 28.5%; } .battle-load.bl-apt .bl-table th:nth-child(2) { width: 13.1%; } .battle-load.bl-apt .bl-table th:nth-child(3) { width: 12.4%; }
.battle-load.battle-load.bl-apt .bl-table th:nth-child(4) { width: 15.9%; } .battle-load.bl-apt .bl-table th:nth-child(5) { width: 30.1%; }
.battle-load.bl-apt .bl-table td:last-child { width: auto; }
.battle-load.bl-apt .bl-level { display: inline-block; width: calc(var(--apt-sy) * 18); height: calc(var(--apt-sy) * 18); vertical-align: middle; background-size: 100% 100%; }
.battle-load.bl-apt .bl-swatch { width: calc(var(--apt-sy) * 18); height: calc(var(--apt-sy) * 14); border-radius: 0; }
.battle-load.bl-apt .bl-bar { display: inline-block; width: 94%; height: calc(var(--apt-sy) * 8); vertical-align: middle; background: #1a0b07; border: 1px solid #6b4a2a; box-shadow: inset 0 1px 2px #000; }

/* Beta 13 item 5: with the pack's MainMenu movie (ShellMenu.js) the page is 1.06's main menu over the shell map; the older menu stays in the page (its buttons are what the movie's act
   on) but is not drawn. */
#aptMenu { position: absolute; inset: 0; z-index: 3; }
#aptMenu[hidden] { display: none; }
html.shell-apt #menu { background: none !important; overflow: hidden; }
html.shell-apt #menu > :not(#aptMenu):not(#packNotice) { visibility: hidden; pointer-events: none; }
html.shell-apt #menu .menu-content, html.shell-apt #menu .menu-frame { visibility: hidden; }

/* Beta 13 item 5: 1.06's skirmish setup (SkirmishSetup.js). The movie's art is on a canvas; the gadgets are DOM over its stage (--apt-sx / --apt-sy: px per stage unit). The older form stays in
   the page as the state the screen reads, and is not drawn. */
#aptSetup { position: absolute; inset: 0; z-index: 3; }
#aptSetup[hidden] { display: none; }
html.shell-apt-setup #setup { background: none !important; overflow: hidden; padding: 0; }
html.shell-apt-setup #setup > :not(#aptSetup) { visibility: hidden; pointer-events: none; }
.sk-host { overflow: hidden; background: #1a0503; }
.sk-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.sk-host .apt-canvas { pointer-events: none; }
.sk-cell { display: block; margin: 0; padding: 0 calc(var(--apt-sx) * 32) 0 calc(var(--apt-sx) * 8); border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left; overflow: hidden; white-space: nowrap; cursor: pointer;
  font: 400 calc(var(--apt-sy) * 19)/1 var(--apt-font); color: #fff; -webkit-tap-highlight-color: transparent; }
.sk-cell span { display: block; overflow: hidden; text-overflow: clip; }
.sk-cell:disabled { cursor: default; opacity: 1; }
/* beta 14 minor 3: a touch hit area is 44 px high; the combos sit 23 px apart, so a live cell reaches into the dead rows around it (setup `extendTargets` sets --ext-t / --ext-b), which let the touch through */
.sk-cell:not(:disabled) { overflow: visible; }
.sk-cell:not(:disabled)::after { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--ext-t, 0px) * -1); bottom: calc(var(--ext-b, 0px) * -1); }
@media (pointer: coarse) { .sk-cell:disabled { pointer-events: none; } }
.sk-cell.dim { color: #b7aaa6; }
.sk-cell:focus-visible, .sk-list .sk-map:focus-visible, .sk-dropitem:focus-visible { outline: none; box-shadow: inset 0 0 0 1px #f3cf86; }
.sk-cell.sk-color { padding: 0; }
.sk-cell.sk-color span { width: calc(var(--apt-sx) * 24); height: calc(var(--apt-sy) * 21); margin: calc(var(--apt-sy) * 2) 0 0 calc(var(--apt-sx) * 3); background: var(--sk-color, transparent); border: 1px solid rgba(0, 0, 0, .7); text-align: center; line-height: calc(var(--apt-sy) * 21); font-size: calc(var(--apt-sy) * 19); }
.sk-cell.sk-color.dead span { background: #000; color: #fff; font-weight: 700; }
.sk-cell.sk-option, .sk-cell.sk-maptype { font-size: calc(var(--apt-sy) * 17); }
.sk-optlabel { display: block; text-align: right; font: 400 calc(var(--apt-sy) * 16)/calc(var(--apt-sy) * 26) var(--apt-font); color: #d4903f; white-space: nowrap; pointer-events: none; }
.sk-check { display: flex; align-items: center; gap: calc(var(--apt-sx) * 8); cursor: pointer; font: 400 calc(var(--apt-sy) * 16)/1 var(--apt-font); color: #d4903f; }
.sk-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sk-box { flex: none; width: calc(var(--apt-sy) * 18); height: calc(var(--apt-sy) * 18); border: 1px solid #a5603a; background: rgba(30, 8, 4, .8); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5); }
.sk-check input:checked + .sk-box { background: radial-gradient(circle, #f0b25a 0 38%, rgba(30, 8, 4, .8) 42%); }
.sk-check input:focus-visible + .sk-box { box-shadow: 0 0 0 2px #f3cf86; }
.sk-picture { display: block; width: 100%; height: 100%; object-fit: fill; }
.sk-info { overflow-y: auto; padding: calc(var(--apt-sy) * 3) calc(var(--apt-sx) * 8); color: #fff; font: 400 calc(var(--apt-sy) * 16)/1.2 var(--apt-font); scrollbar-width: thin; scrollbar-color: #a5603a transparent; }
.sk-info p { margin: 0; }
.sk-list { margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #a5603a transparent; }
.sk-map { height: calc(var(--apt-sy) * var(--sk-row, 26)); padding: 0 calc(var(--apt-sx) * 6) 0 calc(var(--apt-sx) * 34); font: 400 calc(var(--apt-sy) * 19)/calc(var(--apt-sy) * var(--sk-row, 26)) var(--apt-font); color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; position: relative; }
.sk-map::before { content: "\2736"; position: absolute; left: calc(var(--apt-sx) * 8); color: #d9d0c8; font: 400 calc(var(--apt-sy) * 18)/calc(var(--apt-sy) * var(--sk-row, 26)) sans-serif; }
.sk-map.on { background: linear-gradient(180deg, #b5946a 0%, #a8631f 28%, #8f5019 100%); }
/* beta 15 minor 3: 1.06's list box (ScrollBar.js): the scroller to the left, whole rows only (its height is a number of rows, set by the bar), the bar in the right 27 stage units */
.sk-box { overflow: hidden; }
.sk-box > .sk-info, .sk-box > .sk-list { position: absolute; left: 0; top: 0; width: calc(100% - var(--apt-sx) * 27); height: 100%; box-sizing: border-box; scrollbar-width: none; overscroll-behavior: contain; }
.sk-box > .sk-info { padding: 0 calc(var(--apt-sx) * 8); }
.sk-box > .sk-info::-webkit-scrollbar, .sk-box > .sk-list::-webkit-scrollbar { display: none; }
.sk-bar { position: absolute; right: 0; top: 0; bottom: 0; width: calc(var(--apt-sx) * 27); touch-action: none; user-select: none; -webkit-user-select: none; }
.sk-bar canvas { display: block; width: 100%; height: 100%; cursor: default; }
.sk-card { display: flex; flex-direction: column; align-items: center; gap: calc(var(--apt-sy) * 6); pointer-events: none; }
.sk-cardname { margin: 0; font: 400 calc(var(--apt-sy) * 17)/1 var(--apt-font); color: #fff; letter-spacing: .04em; }
.sk-clip.fclip { position: static; width: calc(var(--apt-sy) * 128); height: calc(var(--apt-sy) * 128); border-width: 1px; }
.sk-drop { margin: 0; padding: 0; list-style: none; z-index: 6; overflow-y: auto; background: rgba(28, 7, 3, .98); border: 1px solid #a5603a; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); scrollbar-width: thin; scrollbar-color: #a5603a transparent; }
.sk-dropitem { height: calc(var(--apt-sy) * var(--row, 25)); padding: 0 calc(var(--apt-sx) * 8); font: 400 calc(var(--apt-sy) * 18)/calc(var(--apt-sy) * var(--row, 25)) var(--apt-font); color: #fff; white-space: nowrap; cursor: pointer; }
.sk-dropitem:hover, .sk-dropitem:focus { background: linear-gradient(180deg, #b5946a 0%, #a8631f 28%, #8f5019 100%); }
.sk-dropitem.on { color: #f5b560; }

/* the phone: the page scrolls at the width of the screen, its foot (START GAME, BACK) stays */
.sk-scroll .sk-scroller { position: absolute; left: 0; right: 0; top: 0; bottom: var(--sk-foot, 0); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.sk-scroll .sk-page { position: relative; width: 100%; height: calc(var(--sk-w, 100vw) * .75); }
.sk-scroll .sk-foot { position: absolute; left: 0; right: 0; bottom: 0; height: var(--sk-foot, 0); }
.sk-uniform .sk-cell { font-size: calc(var(--apt-sy) * 16); } .sk-uniform .sk-cell.sk-option, .sk-uniform .sk-cell.sk-maptype { font-size: calc(var(--apt-sy) * 15); }
.sk-uniform .sk-map { font-size: calc(var(--apt-sy) * 17); } .sk-uniform .sk-info { font-size: calc(var(--apt-sy) * 14); } .sk-uniform .sk-dropitem { font-size: calc(var(--apt-sy) * 16); }

/* the Options screen opened from the main menu (OptionsMenu.js): this game's own actions as brass rows in DISPLAY OPTIONS, and Detail's list */
.apt-extra { display: block; margin: 0; padding: 0 calc(var(--apt-sx) * 6); border: 0; border-bottom: 1px solid rgba(165, 96, 58, .55); border-radius: 0; background: none; box-shadow: none; text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer; font: 400 calc(var(--apt-sy) * 17)/1 var(--apt-font); color: #d4903f; }
.apt-extra:hover, .apt-extra:focus-visible { color: #fff; outline: none; background: linear-gradient(180deg, rgba(181, 148, 106, .35), rgba(143, 80, 25, .35)); }
.apt-drop { margin: 0; padding: 0; list-style: none; z-index: 6; background: rgba(28, 7, 3, .98); border: 1px solid #a5603a; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); }
.apt-drop li { height: calc(var(--apt-sy) * var(--row, 25)); padding: 0 calc(var(--apt-sx) * 8); font: 400 calc(var(--apt-sy) * 17)/calc(var(--apt-sy) * var(--row, 25)) var(--apt-font); color: #fff; cursor: pointer; }
.apt-drop li:hover, .apt-drop li:focus { background: linear-gradient(180deg, #b5946a 0%, #a8631f 28%, #8f5019 100%); outline: none; }
.apt-drop li.on { color: #f5b560; }

/* Beta 13 item 5: the multiplayer rooms in the shell's frame (ShellFrame.js: backdrop, title plaque, pattern bar) and colours: the movies have no page for them, so the page keeps its own
   controls and takes the closest 1.06 screen's dress (the skirmish setup's panels and brass). */
.shell-frame { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.shell-frame[hidden] { display: none; }
.shell-frame-bd { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.shell-frame .apt-canvas { pointer-events: none; }
html.shell-apt-mp #mp { background: none !important; padding-top: clamp(64px, 17vh, 150px); }
html.shell-apt-mp #mp > .wrap { position: relative; z-index: 1; }
html.shell-apt-mp #mp .page-heading h1, html.shell-apt-mp #mp .page-heading > p, html.shell-apt-mp #mp .screen-header .eyebrow { display: none; }
html.shell-apt-mp #mp, html.shell-apt-mp #mp * { font-family: var(--apt-font); }
html.shell-apt-mp #mp .mp-card, html.shell-apt-mp #mp .mp-code-card, html.shell-apt-mp #mp .mp-seat, html.shell-apt-mp #mp .fcard, html.shell-apt-mp #mp .gcard {
  background: rgba(39, 13, 1, .55); border: 1px solid rgba(214, 156, 124, .9); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0), 0 0 0 5px rgba(150, 82, 62, .6); color: #fff; }
html.shell-apt-mp #mp .mp-card h2, html.shell-apt-mp #mp .sec-label { color: #fff; font-weight: 400; letter-spacing: 0; }
html.shell-apt-mp #mp .mbtn, html.shell-apt-mp #mp .primary, html.shell-apt-mp #mp .compact-btn, html.shell-apt-mp #mp .back, html.shell-apt-mp #mp .text-btn {
  background: linear-gradient(180deg, rgba(60, 22, 8, .9), rgba(28, 7, 3, .95)); border: 1px solid #a5603a; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); color: #d4903f; clip-path: none; text-shadow: none; }
html.shell-apt-mp #mp .mbtn:not(:disabled):hover, html.shell-apt-mp #mp .primary:not(:disabled):hover, html.shell-apt-mp #mp .compact-btn:not(:disabled):hover, html.shell-apt-mp #mp .back:hover {
  background: linear-gradient(180deg, #b5946a 0%, #a8631f 28%, #8f5019 100%); color: #fff; }
html.shell-apt-mp #mp .mbtn::before, html.shell-apt-mp #mp .mbtn::after { display: none; }
html.shell-apt-mp #mp input, html.shell-apt-mp #mp select { background: rgba(28, 7, 3, .92); border: 1px solid #a5603a; border-radius: 0; color: #fff; }
html.shell-apt-mp #mp .mp-name, html.shell-apt-mp #mp .mp-card label, html.shell-apt-mp #mp .mp-help, html.shell-apt-mp #mp .mp-status, html.shell-apt-mp #mp small { color: #d4903f; }
