/* Shift 1: the status bar is DOM under the picture (bar.js), not pixels in the canvas.
   Desktop and landscape: the picture fills everything above a slim bar. A standing phone: the picture takes
   all the height between the HUD and the bar, the bar sits right above the touch controls. */
.first-shift { --fs-bar: 64px; }
@media (max-height: 500px) { .first-shift { --fs-bar: 46px; } }
.first-shift .first-shift__canvas { inset: 0 auto auto 0; width: 100%; height: calc(100% - var(--fs-bar)); }   /* a canvas is a replaced element: the height is given, not stretched by top+bottom */
.first-shift::after { top: calc((100% - var(--fs-bar)) / 2); }
.first-shift .first-shift__prompt { bottom: calc(var(--fs-bar) + 30px); }
.first-shift .first-shift__dialogue, .first-shift .first-shift__fight { bottom: calc(var(--fs-bar) + 18px); }
.first-shift .first-shift__control { bottom: calc(var(--fs-bar) + 8px); }
.first-shift__bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: var(--fs-bar); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 18px; padding: 0 10px; box-sizing: border-box; border-top: 2px solid #8a8a84; background: linear-gradient(#4a4a46, #2a2a28); box-shadow: inset 0 2px 0 #ffffff22; font: 900 14px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; color: #c9c9c2; pointer-events: none; }
.fsb-cell { display: grid; justify-items: center; gap: 3px; min-width: 70px; }
.fsb-cell small { font-size: 12px; letter-spacing: .08em; color: #9a9a94; }
.fsb-cell b { font-size: 22px; color: #e83c2c; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.fsb-cell b em { font-style: normal; font-size: 16px; }
.fsb-cell b[data-dead="false"] { color: #6ef0ff; }
.fsb-cell b[data-dead="true"] { animation: fsbBlink 1s steps(2) infinite; }
.fsb-cell b[data-gone="true"] { color: #ffc846; }
#fsbArm, #fsbMood { font-size: 17px; }
.fsb-face { height: calc(var(--fs-bar) - 14px); width: auto; aspect-ratio: 24 / 29; image-rendering: pixelated; border: 1px solid #00000088; background: #1a1a1a; }
.fsb-shift { display: grid; gap: 2px; padding: 4px 8px; background: #222; border: 1px solid #000; font-size: 12px; line-height: 1.1; color: #9a9a94; }
.fsb-shift span:first-child { color: #ece8e0; }
.fsb-shift span:last-child { color: #ffc846; }
@keyframes fsbBlink { 50% { color: #78281e; } }
@media (prefers-reduced-motion: reduce) { .fsb-cell b[data-dead="true"] { animation: none; } }
@media (max-height: 500px) {
  .first-shift__bar { gap: 0 14px; }
  .fsb-cell { grid-auto-flow: column; align-items: baseline; gap: 6px; min-width: 0; }
  .fsb-cell b { font-size: 18px; } #fsbArm, #fsbMood { font-size: 14px; }
  .fsb-shift { grid-auto-flow: column; gap: 8px; }
}

@media (orientation: portrait) {
  :root { --fs-top: 156px; }
  .first-shift { --fs-ctl: calc(max(16px, env(safe-area-inset-bottom)) + 120px); --fs-bar: 66px; }
  .first-shift .first-shift__canvas { top: var(--fs-top) !important; height: calc(100% - var(--fs-top) - var(--fs-ctl) - var(--fs-bar)) !important; }
  .first-shift::after { top: calc(var(--fs-top) + (100% - var(--fs-top) - var(--fs-ctl) - var(--fs-bar)) / 2) !important; }
  .first-shift__bar { bottom: var(--fs-ctl); gap: 3px 10px; padding: 4px 6px; align-content: center; }
  .fsb-cell { min-width: 0; gap: 2px; }
  .fsb-cell b { font-size: 18px; } #fsbArm, #fsbMood { font-size: 14px; }
  .fsb-face { height: 34px; }
  .fsb-shift { grid-auto-flow: column; gap: 10px; flex-basis: auto; padding: 2px 8px; }
  .first-shift .first-shift__prompt { top: auto !important; bottom: calc(var(--fs-ctl) + var(--fs-bar) + 8px) !important; width: max-content; max-width: calc(100% - 24px); }
  .first-shift .first-shift__anger { top: auto; bottom: calc(var(--fs-ctl) + var(--fs-bar) + 64px); }
  .first-shift .first-shift__pry { top: auto; bottom: calc(var(--fs-ctl) + var(--fs-bar) + 8px); }
  .game[data-touch="true"] .first-shift .first-shift__fight { top: auto !important; bottom: calc(var(--fs-ctl) + var(--fs-bar) + 8px) !important; }
  .rotate-hint { top: calc(var(--fs-top) + 4px); }
  /* the touch pad in one row under the bar while the shift is on */
  .game:has(#firstShift:not([hidden])) .touch__stick { width: 116px; height: 116px; left: 12px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .game:has(#firstShift:not([hidden])) .touch__use, .game:has(#firstShift:not([hidden])) .touch__punch { width: 84px; height: 84px; right: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
  .game:has(#firstShift:not([hidden])) .touch__use { left: calc(100% - 96px); }
  .game:has(#firstShift:not([hidden])) .touch__punch { left: calc(100% - 184px); }
  .game:has(#firstShift:not([hidden])) .touch__jump { width: 70px; height: 70px; right: auto; left: 132px; bottom: max(16px, env(safe-area-inset-bottom)); }
}
/* 28.11 (dym v1.7.0 --telefon, 844×390: HUD over the frame's centre 52%): a phone on its side keeps the centre for
   the world — ЗЛОСТЬ goes to the top right under the corner row, the controls hint is one short line above the bar. */
@media (pointer:coarse) and (max-height:500px){
  .first-shift .first-shift__anger{left:auto;right:12px;top:calc(max(14px,env(safe-area-inset-top)) + 52px);bottom:auto;transform:none}
  .first-shift .first-shift__prompt{font-size:12px !important;line-height:1.2;max-width:min(52%,440px);padding:4px 10px;bottom:calc(var(--fs-ctl,0px) + var(--fs-bar) + 4px) !important}
}
/* The hall's HUD under Shift 1 (skill recorder, the hall message) is not in play while the shift covers it. */
body:has(.first-shift:not([hidden])) :is(#skillRecorder,#gameMessage){visibility:hidden}
