/*
 * Layout B, Card Hand (docs/plans/19-phone-layouts.md; mockup
 * docs/mockups/mobile-match.html). One dock under one thumb. A card is
 * dragged onto the map to send it (js/match/card-press.js), so a tap on the
 * map never sends. The amount keys show all four, ×1 included, since nothing
 * is held while a card is carried. This file only says where each piece goes.
 */
:root[data-hud='b'][data-phone][data-orient] .amount-key[data-amount='1'] {
  display: inline-flex;
}

:root[data-hud='b'][data-phone][data-orient='portrait'] {
  --hand: 4.5rem;
  --dock-squads: calc(var(--step) + var(--hand) + var(--gap));
  --mm-t: var(--step);
  --mm-w: 7.75rem;
  /* Bottom row: the four amount keys, then the view keys. */
  --vw-b: 0;
  --am-r: 9rem;
  --am-font: var(--text-xs);
  /* The hand: six cards in one row. */
  --dk-r: 0;
  --dk-b: var(--step);
  --dk-cols: repeat(6, minmax(0, 1fr));
  --dk-rows: var(--hand);
  /* All and the five squads in one row above it. */
  --sq-l: 0;
  --sq-b: var(--dock-squads);
  --sq-cols: repeat(6, minmax(0, 1fr));
  --sq-rows: var(--key);
  --all-l: 0;
  --all-b: var(--dock-squads);
  --all-w: calc((100% - 5 * var(--gap)) / 6);
  --tr-b: calc(var(--dock-squads) + var(--step));
}

:root[data-hud='b'][data-phone][data-orient='landscape'] {
  /* A card is as wide as the room allows, between a thumb's width and a little more. */
  --card: clamp(2.75rem, calc((100% - 13.5rem) / 6), 3.75rem);
  --hand: calc(6 * var(--card) + 5 * var(--gap));
  --mn-r: 9.25rem;
  --mm-t: 0;
  --vw-t: calc(8.75rem * 2 / 3 + var(--gap) + 2px);
  --sq-cols: repeat(3, var(--key));
  --sq-rows: repeat(2, var(--key));
  --all-r: calc(2 * var(--step));
  --all-b: var(--step);
  /* The amount keys in a column at the left edge, ×1 nearest the thumb. */
  --am-dir: column-reverse;
  --am-w: var(--key);
  --am-font: var(--text-xs);
  /* The hand beside them, along the bottom. */
  --dk-l: var(--step);
  --dk-w: var(--hand);
  --dk-cols: repeat(6, minmax(0, 1fr));
  --dk-rows: 3.5rem;
  /* The bottom line sits on the hand, and is as wide. */
  --tr-l: var(--step);
  --tr-r: calc(100% - var(--step) - var(--hand));
  --tr-b: calc(3.5rem + var(--gap));
}
