/*
 * Layout C, Glass (docs/plans/19-phone-layouts.md; mockup
 * docs/mockups/mobile-match.html). No panels: cards, squads and numbers sit
 * along the edges like markings on an instrument, over a soft shade so they
 * read against a bright part of the map. It plays as A does. The − and +
 * keys are left out; pinch zooms.
 */
:root[data-hud='c'][data-phone][data-orient='landscape'] {
  --rail: 3rem;
  --past-rail: calc(var(--rail) + var(--gap));
  /* Cards down the left edge, the top bar beside them. */
  --st-l: var(--past-rail);
  --dk-t: 0;
  --dk-w: var(--rail);
  --dk-cols: minmax(0, 1fr);
  --dk-rows: repeat(6, minmax(0, 1fr));
  /* The amount keys in a column beside the lower cards. */
  --am-l: var(--past-rail);
  --am-dir: column;
  --am-w: 2.875rem;
  --am-font: var(--text-xs);
  /* All and the squads down the right edge, Menu beside them. */
  --mn-r: var(--past-rail);
  --sq-t: 0;
  --sq-cols: var(--rail);
  --sq-rows: repeat(6, minmax(0, 1fr));
  --all-t: 0;
  --all-r: 0;
  --all-w: var(--rail);
  --all-h: calc((100% - 5 * var(--gap)) / 6);
  /* The overview in the bottom right, My base beside it, then the bottom line. */
  --mm-b: 0;
  --mm-r: var(--past-rail);
  --mm-w: 8.5rem;
  --vw-b: 0;
  --vw-r: calc(var(--past-rail) + 8.5rem + var(--gap));
  --vw-w: 3.5rem;
  --tr-l: calc(var(--past-rail) + 2.875rem + var(--gap));
  --tr-r: calc(var(--past-rail) + 12rem + 2 * var(--gap));
}

:root[data-hud='c'][data-phone][data-orient='portrait'] {
  --rail: 3rem;
  --deck: 3.25rem;
  --above-deck: calc(var(--deck) + var(--gap));
  --mm-t: var(--step);
  --mm-w: 7.75rem;
  --vw-t: calc(var(--step) + 7.75rem * 2 / 3 + var(--gap) + 2px);
  --vw-w: 3.5rem;
  /* Cards along the bottom. */
  --dk-r: 0;
  --dk-cols: repeat(6, minmax(0, 1fr));
  --dk-rows: var(--deck);
  /* All and the squads up the right edge. */
  --sq-b: var(--above-deck);
  --sq-cols: var(--rail);
  --sq-rows: repeat(6, var(--key));
  --all-r: 0;
  --all-b: calc(var(--above-deck) + 5 * var(--step));
  --all-w: var(--rail);
  /* The amount keys up the left edge, the bottom line between the two. */
  --am-b: var(--above-deck);
  --am-dir: column;
  --am-w: var(--rail);
  --am-font: var(--text-xs);
  --tr-l: calc(var(--rail) + var(--gap));
  --tr-r: calc(var(--rail) + var(--gap));
  --tr-b: var(--above-deck);
  /* The line between the two rails is narrow: fighters get two rows. */
  --tr-wrap: wrap;
}

/* Pinch zooms; My base stays. */
:root[data-hud='c'][data-phone][data-orient] .hud__view-buttons .hud__small:not(.hud__center) {
  display: none;
}

/* ---- The glass: no fills, no frames, only what is lit ---- */
:root[data-hud='c'][data-phone][data-orient]
  :is(
    .hud__identity,
    .hud__menu-toggle,
    .card,
    .group-row,
    .amount-key,
    .touch-tools__fighters,
    .touch-tools__path,
    .hud__view-buttons .button,
    .deck__panel,
    .formation-bar
  ) {
  background: none;
  border-color: transparent;
  text-shadow:
    0 1px 2px #000,
    0 0 8px #000;
}

:root[data-hud='c'][data-phone][data-orient] .card[data-picked='true'],
:root[data-hud='c'][data-phone][data-orient] .group-row[aria-pressed='true'],
:root[data-hud='c'][data-phone][data-orient] .amount-key[aria-pressed='true'] {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
}

:root[data-hud='c'][data-phone][data-orient] .card[data-locked='ready'] {
  border-color: var(--warn);
}

:root[data-hud='c'][data-phone][data-orient] .group-row[data-free='true'] {
  border-color: rgb(255 255 255 / 0.16);
}

/* A thin line under each key says it can be pressed. */
:root[data-hud='c'][data-phone][data-orient] .hud__menu-toggle,
:root[data-hud='c'][data-phone][data-orient] .amount-key:not([aria-pressed='true']),
:root[data-hud='c'][data-phone][data-orient] .touch-tools__fighters,
:root[data-hud='c'][data-phone][data-orient] .hud__view-buttons .button {
  border-bottom-color: var(--line-strong);
  border-radius: 0;
}

:root[data-hud='c'][data-phone][data-orient] .deck__panel,
:root[data-hud='c'][data-phone][data-orient] .formation-bar {
  border-top-color: var(--accent-line);
  border-radius: 0;
}

/* Opened, a sheet of options needs a solid back to be read. */
:root[data-hud='c'][data-phone][data-orient] .deck__panel[data-open='true'],
:root[data-hud='c'][data-phone][data-orient] .formation-bar[data-open='true'] {
  background: var(--bg-1);
  border-color: var(--accent-line);
  text-shadow: none;
}

:root[data-hud='c'][data-phone][data-orient] .minimap__canvas {
  background: rgb(5 7 11 / 0.55);
}

/* The shade along the edges. It never takes a touch. */
:root[data-hud='c'][data-phone][data-orient] .match__hud::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

:root[data-hud='c'][data-phone][data-orient='landscape'] .match__hud::before {
  background:
    linear-gradient(90deg, rgb(5 7 11 / 0.9), rgb(5 7 11 / 0.5) 6rem, transparent 10rem),
    linear-gradient(270deg, rgb(5 7 11 / 0.9), rgb(5 7 11 / 0.5) 5rem, transparent 8rem),
    linear-gradient(180deg, rgb(5 7 11 / 0.85), transparent 3.75rem),
    linear-gradient(0deg, rgb(5 7 11 / 0.85), transparent 5.25rem);
}

:root[data-hud='c'][data-phone][data-orient='portrait'] .match__hud::before {
  background:
    linear-gradient(180deg, rgb(5 7 11 / 0.9), rgb(5 7 11 / 0.55) 5.5rem, transparent 8rem),
    linear-gradient(0deg, rgb(5 7 11 / 0.92), rgb(5 7 11 / 0.6) 6rem, transparent 9.5rem);
}
