/* The classic hero creation page (H7923). Not retail: ours, the owner's request R-0099, built from the original
   site's pieces: the original's creator ran on its publisher's website (battlefieldheroes.com), not in the game, and
   this page lays it out again as his screenshot shows it (analysis/scratch/portal/attachments/R-0099_3.png) with
   the creator's own pictures and geometry, as a copy of the old site kept them (retail/node-heroes-web-master
   views/create.handlebars, public/css/create.css, public/img; brought here by tools/bfheroes/site_assets.py
   --only create into ui/img/create/, never retouched):
   - the paper sheet (siteBg.jpg, 989 px) and on it the framed village scene (bg.jpg 852 x 529 under a 3 px black
     edge with round corners, fullShadow.png behind its top and bottom);
   - the standing hero as the old creator's 2D doll: the headless body picture of the army and class
     (royalCommando.png ... nationalGunner.png, 316 x 407), his ground shadow (shadow.png) and, on top, the head from
     the head sprite (royal.png / national.png, 69 x 92 cells: the skin tone column, the beard and hair rows, the
     hair colour column);
   - his speech bubble (a white box with a 2 px black edge, bubbleArrow.png as the tail) with the old page's words;
   - the wooden board (royal_bg.png / national_bg.png), the two army tabs with their flags (faction_*.png), the three
     class portraits in their two states (icon_*_classes.png), the head panel (characteristics.png) with its two tabs
     (hairSelector.png, hairSelectorIcons.png), the heads (icon_bg.png behind the chosen one), the skin tone and hair
     colour dots in the old page's own colours, and the glossy "surprise me" / "i'm done" bars (buttons_large.png,
     the arrow of ministore-sprite.png) on the board's foot (actions_bg.png);
   - the name step: the old page's own "Give me a name!" bubble over the darkened scene (buttons.png's bars).
   Ours, drawn after his screenshot (no file holds them): the bar of three steps in the site's top bar (with OUR
   flow's words: 1. create a hero, 2. name your hero, 3. play; his reads 2. sign up, 3. download), the lettering
   (the site ships Fredoka in place of the original's Sofia Pro, and no comic face: the bubble's capitals fall back
   to the system's comic face; both originals are commercial fonts), the scaling to the window and the narrow
   layout. Every length below is the old page's at zoom 1; `--cr-zoom` (create.js fit) scales the sheet. */
body.cr-classic { --m-top: 107px; padding-bottom: 0; background: #16283c; }
body.cr-classic #bfh-nav, body.cr-classic #bfh-sub, body.cr-classic #bfh-play, body.cr-classic #bfh-foot,
body.cr-classic #bfh-version { display: none; }
body.cr-classic #bfh-top { border-bottom-width: 0; }
body.cr-classic #bfh-top .band { height: 59px; background: linear-gradient(#151414, #0c0b0b); }
body.cr-classic #bfh-acct { right: 54px; top: 15px; z-index: 52; }
body.cr-classic #bfh-mute { right: 14px; top: 10px; bottom: auto; z-index: 52; }
/* The sound button's slider (R-0100, shell.css) beside the button where this page puts it. */
body.cr-classic #bfh-vol { right: 44px; top: 7px; bottom: auto; z-index: 53; }

/* The bar of three steps, in the red bar's place of the shell's nav: the step on screen is the dark tab with the
   notch (his "1. create a hero"), the others the light words. */
#cr-steps { position: fixed; left: 250px; top: 0; height: 48px; z-index: 51; display: flex; align-items: stretch; gap: 18px; }
#cr-steps ol { display: flex; margin: 0; padding: 0; list-style: none; }
#cr-steps li {
  display: flex; align-items: center; padding: 3px 22px 0 28px; white-space: nowrap;
  font: 600 20px/1 var(--m-font); color: #ecb5a4; text-shadow: var(--m-out); text-transform: lowercase;
}
#cr-steps li.on {
  color: #fff; background: linear-gradient(#5f1b16, #521410);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
}
/* Ours: the way back for an account that already has heroes, in the black band (his band is empty). */
#cr-home {
  position: absolute; left: 20px; top: 63px; padding: 5px 12px; white-space: nowrap; border-radius: 5px; text-decoration: none;
  color: #f1ece2; background: #2c2c2c; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px #000; font: 600 14px/1 var(--m-font); text-shadow: 0 1px 0 #000;
}
#cr-home:hover { background: #3b3b3b; }
#cr-home[hidden] { display: none; }

/* The paper sheet under the bar. */
#cr-main {
  position: relative; width: 989px; margin: 0 auto; padding: 27px 0 30px; zoom: var(--cr-zoom, 1);
  min-height: calc((100vh - var(--m-top)) / var(--cr-zoom, 1));
  background: #e6dac1 url('/play/heroes/ui/img/create/paper.webp') center top / 100% 100% no-repeat;
}

/* The framed scene (create.css #createHero and its > .inner). */
#cr-frame, #cr-frame * { box-sizing: content-box; }
#cr-frame {
  position: relative; z-index: 3; width: 852px; margin: 0 auto; padding: 3px; border-radius: 10px;
  font: 12px/1.3em Arial, sans-serif; color: #000; user-select: none;
  --cr-header: var(--m-font);
  --cr-comic: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Comic Neue', var(--m-font);
  --cr-out: 2px 1px 0 #000, -2px 1px 0 #000, -2px -1px 0 #000, 2px -1px 0 #000, 1px 2px 0 #000, -1px 2px 0 #000, -1px -2px 0 #000,
    1px -2px 0 #000, 2px 2px 0 #000, -2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, 1px 1px 0 #000, -1px 1px 0 #000, -1px -1px 0 #000,
    1px -1px 1px #000;
}
#cr-frame::before, #cr-frame::after {
  content: ''; position: absolute; width: 840px; height: 134px;
  background: url('/play/heroes/ui/img/create/frame_shadow.webp') no-repeat left top;
}
#cr-frame::before { right: -5px; top: -13px; }
#cr-frame::after { background-position: left bottom; left: -5px; bottom: -14px; }
.cr-inner {
  position: relative; z-index: 1; height: 504px; padding: 23px 38px 0 459px;
  background: #c4baa6 url('/play/heroes/ui/img/create/village.webp') no-repeat -1px -1px;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 5px; box-shadow: 0 0 0 3px #000;
}
#cr-frame button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
#cr-frame button:focus-visible { outline: 2px solid #2e7fbf; outline-offset: -2px; }

/* The standing hero (create.css .preview, .doll, .face): the body picture, the head cell over its collar. */
.preview {
  position: absolute; top: 20px; left: -1px; width: 420px; height: 500px;
  background: url('/play/heroes/ui/img/create/doll_shadow.webp') no-repeat -35px 445px;
}
.doll-box { position: absolute; left: 0; top: 0; width: 330px; height: 485px; }
.doll { position: absolute; top: 0; left: 25px; width: 305px; height: 485px; background: no-repeat 0 75px; }
.face { position: absolute; left: 107px; top: 10px; width: 69px; height: 92px; overflow: hidden; }
#cr-frame.side-1 .face { left: 105px; top: 19px; }

/* The speech bubble (create.css .preview .help and .help:before): 200 px, white, a 2 px black edge, square corners;
   the tail (bubbleArrow.png, 43 x 19 of it) outside the left edge, pointing at the hero. The title is centred, the
   body starts at the left as his screenshot has it. */
.bubble, .name-box {
  position: absolute; top: 20px; left: 210px; width: 200px; padding: 8px 10px 12px; z-index: 2;
  background: #fff; border: 2px solid #000; color: #000; -webkit-text-stroke-width: .1px;
  font-family: var(--cr-comic); font-weight: 700; font-style: italic; text-transform: uppercase;
}
.bubble[hidden] { display: none; }
.bubble::before, .name-box::before {
  content: ''; position: absolute; left: -43px; top: 30px; width: 43px; height: 19px;
  background: url('/play/heroes/ui/img/create/bubble_arrow.webp') no-repeat;
}
.bubble header, .name-box .nhead { display: block; font-size: 13.1px; line-height: 16.8px; margin-bottom: 10px; text-align: center; }
.bubble p { margin: 0; font-size: 11px; line-height: 16.8px; text-align: left; }
/* The original's comic face (the old page's 14.4 px title and 12 px body) is lower and wider than the system's: the
   words are set smaller (13.1 and 11 px, the title pressed 8 % narrower), so the lines break where his do and
   stand as high as his; the lines are 16.8 px apart, as measured in his picture (its height is squeezed by its
   recorder: 1.71 px a CSS px down, 1.81 across; the lengths here are the unsqueezed ones). */
.bubble header, .name-box .nhead { width: 108.2%; transform: scaleX(.924); transform-origin: 0 0; }
.bubble { transition: opacity .12s ease; }
.bubble.flip { opacity: 0; }

/* The wooden board: the army tabs over its top (royal_bg / national_bg: the chosen army's tab is the light wood). */
#board { position: relative; width: 353px; }
.hero-type { background: url('/play/heroes/ui/img/create/board_royal.webp') no-repeat; }
#board.side-1 .hero-type { background-image: url('/play/heroes/ui/img/create/board_national.webp'); }
.factions { position: relative; height: 47px; }
#cr-frame .faction { position: absolute; top: -22px; width: 200px; height: 67px; background: no-repeat; }
#cr-frame .faction.f2 { left: -30px; background-image: url('/play/heroes/ui/img/create/flag_royal.webp'); }
#cr-frame .faction.f1 { right: -34px; background-image: url('/play/heroes/ui/img/create/flag_national.webp'); }
.faction span, .kit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.classes { clear: both; padding: 12px 0 12px 13px; overflow: hidden; }
#cr-frame .kit {
  float: left; width: 82px; height: 79px; margin-left: 20px; position: relative;
  background: url('/play/heroes/ui/img/create/classes_royal.webp') no-repeat;
}
#cr-frame #board.side-1 .kit { background-image: url('/play/heroes/ui/img/create/classes_national.webp'); }
#cr-frame .kit.k0 { background-position: -166px top; }
#cr-frame .kit.k1 { background-position: 0 top; }
#cr-frame .kit.k2 { background-position: -83px top; }
#cr-frame .kit.k0:hover, #cr-frame .kit.k0[aria-checked='true'] { background-position: -166px bottom; }
#cr-frame .kit.k1:hover, #cr-frame .kit.k1[aria-checked='true'] { background-position: 0 bottom; }
#cr-frame .kit.k2:hover, #cr-frame .kit.k2[aria-checked='true'] { background-position: -83px bottom; }

/* The head panel (characteristics.png: the tab strip, the white glossy grid, the grey colour bar; create.css
   .characteristics, .hairSelector and its tabs' icons). */
.barber { background: url('/play/heroes/ui/img/create/barber.webp') no-repeat; }
.barber-tabs {
  position: relative; height: 235px; margin: -3px 2px 0; clear: both;
  background: url('/play/heroes/ui/img/create/barber_tabs.webp') no-repeat left top;
}
.barber-tabs.tab-hair { background-position: right top; }
#cr-frame .btab { position: absolute; top: 0; width: 132px; height: 42px; background: url('/play/heroes/ui/img/create/barber_icons.webp') no-repeat; }
#cr-frame .btab.hair { left: 40px; background-position: center -37px; }
#cr-frame .btab.beard { left: 178px; background-position: center 3px; }
/* Five heads to a row from the left, as the old .hairSelector li floats. */
.heads { position: absolute; top: 48px; left: 0; width: 350px; }
#cr-frame .head { float: left; position: relative; width: 69px; height: 92px; overflow: hidden; }
#cr-frame .head:hover, #cr-frame .head[aria-checked='true'] { background: url('/play/heroes/ui/img/create/head_bg.webp') no-repeat 5px 10px; }
/* A head: the sprite's layers (create.css .icon_shadow / _skin / _facialHair / _hair / .facialFeatures). */
.head i, .face i { position: absolute; top: 0; left: 0; height: 92px; width: 69px; background: url('/play/heroes/ui/img/create/heads_royal.webp') no-repeat; pointer-events: none; }
#cr-frame.side-1 .head i, #cr-frame.side-1 .face i { background-image: url('/play/heroes/ui/img/create/heads_national.webp'); }
.head i.hr, .face i.hr { width: 450px; }
.head i.fh, .face i.fh { width: 350px; }
/* The skin tone and hair colour dots (create.css .colorSelector, .skinColor / .hairColor li): 7 px, a 2 px black
   ring, the chosen one with the white ring inside it. */
.colours { height: 46px; padding-top: 7px; }
.colours .lbl { clear: left; float: left; width: 150px; text-align: right; font: 600 14.4px/1.3em var(--cr-header); color: #000; }
.dots { float: left; width: 180px; padding: 4px 0 3px 10px; }
#cr-frame .dot { float: left; width: 7px; height: 7px; padding: 2px; margin: 0 3px; border-radius: 5px; box-shadow: 0 0 0 2px #000; }
#cr-frame .dot:hover { box-shadow: 0 0 0 2px #000, 0 0 0 3px #fff; }
#cr-frame .dot[aria-checked='true'] { border: 2px solid #fff; padding: 0; }

/* The board's foot and the glossy bars (create.css .actions #randomHero / #saveHero, their .decoration end and the
   :before arrow): buttons_large.png's rows at -41 (green), -123 (blue), the lit ones 41 px under each. */
.actions { background: url('/play/heroes/ui/img/create/actions.webp') no-repeat left bottom; overflow: hidden; padding: 7px; }
#cr-frame .cr-btn {
  position: relative; display: inline-block; width: 115px; height: 40px; margin-right: 10px; padding: 0 11px 0 30px; overflow: visible;
  font: 600 16.8px/35px var(--cr-header); color: #fff; text-align: center; text-transform: lowercase; text-shadow: var(--cr-out);
  background: url('/play/heroes/ui/img/create/buttons_large.webp') no-repeat;
}
.cr-btn .dec { position: absolute; right: -8px; top: 0; width: 8px; height: 40px; background: url('/play/heroes/ui/img/create/buttons_large.webp') no-repeat; }
.cr-btn::before {
  content: ''; position: absolute; top: 12px; left: 11px; width: 13px; height: 15px;
  background: url('/play/heroes/ui/img/create/ministore.webp') no-repeat -136px -48px;
}
#cr-frame #done { float: right; background-position: left -41px; }
#done .dec { background-position: right -41px; }
#cr-frame #done:hover { background-position: left -82px; }
#done:hover .dec { background-position: right -82px; }
#cr-frame #random { float: left; background-position: left -123px; }
#random .dec { background-position: right -123px; }
#cr-frame #random:hover { background-position: left -164px; }
#random:hover .dec { background-position: right -164px; }

/* Step 2, the name (create.css .overlay, .nameSelector, .heroName, #chooseName / #cancelName, .error): the scene
   under a half-dark sheet, the hero's bubble asking for his name, the small bars of buttons.png (-217 the black
   "back", -31 the green "create", the lit ones 31 px under each), the answer in the white box under the bubble. */
.naming { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .5); border-radius: 4px; }
.naming[hidden] { display: none; }
.name-wrap { position: absolute; top: 20px; left: 210px; width: 224px; }
.name-box { position: relative; top: 0; left: 0; }
#cr-frame .name-box input {
  display: block; width: 180px; height: 16px; margin: 0 0 7px; padding: 2px; border: 2px solid #000; border-radius: 5px;
  background: #fff; color: #000; font: 13.2px/16px Arial, sans-serif; text-align: left; text-transform: none; user-select: text;
}
#cr-frame .name-box input[aria-invalid='true'] { border-color: #b3261e; }
.name-box .row { display: block; height: 30px; font-style: normal; }
#cr-frame .cr-btn.small { width: auto; min-width: 44px; height: 30px; padding: 0 5px 0 25px; font-size: 16.8px; line-height: 25px; background-image: url('/play/heroes/ui/img/create/buttons.webp'); }
.cr-btn.small .dec { height: 30px; background-image: url('/play/heroes/ui/img/create/buttons.webp'); }
.cr-btn.small::before { top: 6px; left: 8px; }
#cr-frame #back { background-position: left -217px; margin-right: 18px; }
#back .dec { background-position: right -217px; }
#cr-frame #back:hover { background-position: left -248px; }
#back:hover .dec { background-position: right -248px; }
#cr-frame #create { background-position: left -31px; }
#create .dec { background-position: right -31px; }
#cr-frame #create:hover { background-position: left -62px; }
#create:hover .dec { background-position: right -62px; }
#cr-frame #create:disabled, #cr-frame #back:disabled { background-position: left 0; cursor: default; }
#create:disabled .dec, #back:disabled .dec { background-position: right 0; }
.name-msg {
  position: relative; z-index: 1; width: 170px; margin: -4px 0 0 10px; padding: 5px 15px 5px;
  background: #fff; border: 2px solid #000; color: #000; font-size: 10.8px; line-height: 1.3em; text-align: center;
}
.name-msg:empty { display: none; }
.name-msg.ok { color: #2f6d1d; }
.name-msg.error { color: #b3261e; }

/* A narrow window (a phone): the hero and his bubble over the board, the board scaled to the width (create.js fit). */
@media (max-width: 899px) {
  body.cr-classic { --m-top: 104px; }
  body.cr-classic #bfh-top .band { height: 40px; }
  /* The sound button in the black band (the steps fill the red bar), its slider under the bar as on the shell's phone. */
  body.cr-classic #bfh-mute { right: 6px; top: auto; bottom: 7px; }
  body.cr-classic #bfh-vol { right: 6px; top: calc(100% + 10px); }
  #cr-steps { left: 112px; top: 12px; height: 40px; right: 0; overflow: hidden; }
  #cr-steps li { font-size: 12.5px; padding: 2px 6px 0 16px; }
  #cr-steps li:not(.on) { padding: 2px 4px 0 4px; }
  #cr-home { display: none; }
  #cr-main { width: auto; min-height: calc(100vh - var(--m-top)); padding: 10px 0 24px; overflow: hidden; zoom: 1; }
  #cr-frame { width: auto; margin: 0 6px; }
  #cr-frame::before, #cr-frame::after { display: none; }
  .cr-inner { height: auto; padding: 0 0 14px; background-size: auto 100%; background-position: 18% top; }
  .preview { position: relative; top: 0; left: 0; width: auto; height: 300px; overflow: hidden; background: none; }
  .doll-box { zoom: .6; }
  .bubble { left: 212px; right: 6px; top: 10px; width: auto; padding: 6px 7px 8px; }
  .bubble header { font-size: 11.5px; margin-bottom: 5px; }
  .bubble p { font-size: 10.5px; }
  .bubble::before { left: -30px; top: 22px; width: 30px; background-position: right top; }
  #board { margin: 26px auto 0; zoom: var(--cr-board-zoom, 1); }
  .name-wrap { left: 50%; top: 96px; margin-left: -112px; }
  .name-box::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bubble { transition: none; } }
