/**
 * 98.css
 * Copyright (c) 2020 Jordan Scales <thatjdanisso.cool>
 * https://github.com/jdan/98.css/blob/main/LICENSE
 */

:root {
  /* Color */
  --text-color: #222222;
  --surface: #c0c0c0;
  --button-highlight: #ffffff;
  --button-face: #dfdfdf;
  --button-shadow: #808080;
  --window-frame: #0a0a0a;
  --dialog-blue: #000080;
  --dialog-blue-light: #1084d0;
  --dialog-gray: #808080;
  --dialog-gray-light: #b5b5b5;
  --link-blue: #0000ff;

  /* Spacing */
  --element-spacing: 8px;
  --grouped-button-spacing: 6px;
  --grouped-element-spacing: 12px;
  --radio-width: 12px;
  --checkbox-width: 13px;
  --radio-label-spacing: 6px;
  --range-track-height: 6px;
  --range-spacing: 12px;

  /* Some detailed computations for radio buttons and checkboxes */
  --radio-total-width-precalc: var(--radio-width) + var(--radio-label-spacing);
  --radio-total-width: calc(var(--radio-total-width-precalc));
  --radio-left: calc(-1 * var(--radio-total-width-precalc));
  --radio-dot-width: 4px;
  --radio-dot-top: calc(var(--radio-width) / 2 - var(--radio-dot-width) / 2);
  --radio-dot-left: calc(-1 * (var(--radio-total-width-precalc)) + var(--radio-width) / 2 - var(--radio-dot-width) / 2);

  --checkbox-total-width-precalc: var(--checkbox-width) + var(--radio-label-spacing);
  --checkbox-total-width: calc(var(--checkbox-total-width-precalc));
  --checkbox-left: calc(-1 * var(--checkbox-total-width-precalc));
  --checkmark-width: 7px;
  --checkmark-left: 3px;

  /* Borders */
  --border-width: 1px;
  --border-raised-outer: inset -1px -1px var(--window-frame), inset 1px 1px var(--button-highlight);
  --border-raised-inner: inset -2px -2px var(--button-shadow), inset 2px 2px var(--button-face);
  --border-sunken-outer: inset -1px -1px var(--button-highlight), inset 1px 1px var(--window-frame);
  --border-sunken-inner: inset -2px -2px var(--button-face), inset 2px 2px var(--button-shadow);
  --default-button-border-raised-outer: inset -2px -2px var(--window-frame), inset 1px 1px var(--window-frame);
  --default-button-border-raised-inner: inset 2px 2px var(--button-highlight), inset -3px -3px var(--button-shadow),
    inset 3px 3px var(--button-face);
  --default-button-border-sunken-outer: inset 2px 2px var(--window-frame), inset -1px -1px var(--window-frame);
  --default-button-border-sunken-inner: inset -2px -2px var(--button-highlight), inset 3px 3px var(--button-shadow),
    inset -3px -3px var(--button-face);

  /* Window borders flip button-face and button-highlight */
  --border-window-outer: inset -1px -1px var(--window-frame), inset 1px 1px var(--button-face);
  --border-window-inner: inset -2px -2px var(--button-shadow), inset 2px 2px var(--button-highlight);

  /* Field borders (checkbox, input, etc) flip window-frame and button-shadow */
  --border-field: inset -1px -1px var(--button-highlight), inset 1px 1px var(--button-shadow),
    inset -2px -2px var(--button-face), inset 2px 2px var(--window-frame);
  --border-status-field: inset -1px -1px var(--button-face), inset 1px 1px var(--button-shadow);

  /* Tabs */
  --border-tab: inset -1px 0 var(--window-frame), inset 1px 1px var(--button-face), inset -2px 0 var(--button-shadow),
    inset 2px 2px var(--button-highlight);
}

@font-face {
  font-family: 'Pixelated MS Sans Serif';
  src: url('/assets/ms_sans_serif-C3pax6mQ.woff') format('woff');
  src: url('/assets/ms_sans_serif-Du8rjN1q.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Pixelated MS Sans Serif';
  src: url('/assets/ms_sans_serif_bold-B8yxhAcs.woff') format('woff');
  src: url('/assets/ms_sans_serif_bold-D5dpRRHG.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
}

body {
  font-family: Arial;
  font-size: 12px;
  color: var(--text-color);
}

button,
label,
input,
legend,
textarea,
select,
option,
table,
ul.tree-view,
.window,
.title-bar,
li[role='tab'] {
  font-family: 'Pixelated MS Sans Serif', Arial;
  -webkit-font-smoothing: none;
  font-size: 11px;
}

h1 {
  font-size: 5rem;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.5rem;
}

u {
  text-decoration: none;
  border-bottom: 0.5px solid #222222;
}

button,
input[type='submit'],
input[type='reset'] {
  box-sizing: border-box;
  border: none;
  color: transparent;
  text-shadow: 0 0 var(--text-color);
  background: var(--surface);
  box-shadow: var(--border-raised-outer), var(--border-raised-inner);
  border-radius: 0;

  min-width: 75px;
  min-height: 23px;
  padding: 0 12px;
}

button.default,
input[type='submit'].default,
input[type='reset'].default {
  box-shadow: var(--default-button-border-raised-outer), var(--default-button-border-raised-inner);
}

.vertical-bar {
  width: 4px;
  height: 20px;
  background: #c0c0c0;
  box-shadow: var(--border-raised-outer), var(--border-raised-inner);
}

button:not(:disabled):active,
input[type='submit']:not(:disabled):active,
input[type='reset']:not(:disabled):active {
  box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
  text-shadow: 1px 1px var(--text-color);
}

button.default:not(:disabled):active,
input[type='submit'].default:not(:disabled):active,
input[type='reset'].default:not(:disabled):active {
  box-shadow: var(--default-button-border-sunken-outer), var(--default-button-border-sunken-inner);
}

@media (not(hover)) {
  button:not(:disabled):hover,
  input[type='submit']:not(:disabled):hover,
  input[type='reset']:not(:disabled):hover {
    box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
  }
}

button:focus,
input[type='submit']:focus,
input[type='reset']:focus {
  outline: 1px dotted #000000;
  outline-offset: -4px;
}

button::-moz-focus-inner,
input[type='submit']::-moz-focus-inner,
input[type='reset']::-moz-focus-inner {
  border: 0;
}

:disabled,
:disabled + label,
input[readonly],
input[readonly] + label {
  color: var(--button-shadow);
}

button:disabled,
input[type='submit']:disabled,
input[type='reset']:disabled,
:disabled + label {
  text-shadow: 1px 1px 0 var(--button-highlight);
}

.window {
  box-shadow: var(--border-window-outer), var(--border-window-inner);
  background: var(--surface);
  padding: 3px;
}

.title-bar {
  background: linear-gradient(90deg, var(--dialog-blue), var(--dialog-blue-light));
  padding: 3px 2px 3px 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-bar.inactive {
  background: linear-gradient(90deg, var(--dialog-gray), var(--dialog-gray-light));
}

.title-bar-text {
  font-weight: bold;
  color: white;
  letter-spacing: 0;
  margin-right: 24px;
}

.title-bar-controls {
  display: flex;
}

.title-bar-controls button {
  padding: 0;
  display: block;
  min-width: 16px;
  min-height: 14px;
}

.title-bar-controls button:active {
  padding: 0;
}

.title-bar-controls button:focus {
  outline: none;
}

.title-bar-controls button[aria-label='Minimize'],
.title-bar-controls button[aria-label].minimize {
  background-image: url("data:image/svg+xml,%3csvg%20width='6'%20height='2'%20viewBox='0%200%206%202'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='6'%20height='2'%20fill='black'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: bottom 3px left 4px;
}

.title-bar-controls button[aria-label='Maximize'],
.title-bar-controls button[aria-label].maximize {
  background-image: url("data:image/svg+xml,%3csvg%20width='9'%20height='9'%20viewBox='0%200%209%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%200H0V2V8V9H1H8H9V8V2V0ZM8%202H1V8H8V2Z'%20fill='black'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: top 2px left 3px;
}

.title-bar-controls button[aria-label='Maximize']:disabled,
.title-bar-controls button[aria-label].maximize:disabled {
  background-image: url("data:image/svg+xml,%3csvg%20width='10'%20height='10'%20viewBox='0%200%2010%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%201H1V3V9V10H2H9H10V9V3V1ZM9%203H2V9H9V3Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%200H0V2V8V9H1H8H9V8V2V0ZM8%202H1V8H8V2Z'%20fill='%23808080'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: top 2px left 3px;
}

.title-bar-controls button[aria-label='Restore'],
.title-bar-controls button[aria-label].restore {
  background-image: url("data:image/svg+xml,%3csvg%20width='8'%20height='9'%20viewBox='0%200%208%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='2'%20width='6'%20height='2'%20fill='black'/%3e%3crect%20x='7'%20y='2'%20width='1'%20height='4'%20fill='black'/%3e%3crect%20x='2'%20y='2'%20width='1'%20height='1'%20fill='black'/%3e%3crect%20x='6'%20y='5'%20width='1'%20height='1'%20fill='black'/%3e%3crect%20y='3'%20width='6'%20height='2'%20fill='black'/%3e%3crect%20x='5'%20y='5'%20width='1'%20height='4'%20fill='black'/%3e%3crect%20y='5'%20width='1'%20height='4'%20fill='black'/%3e%3crect%20x='1'%20y='8'%20width='4'%20height='1'%20fill='black'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: top 2px left 3px;
}

.title-bar-controls button[aria-label='Help'],
.title-bar-controls button[aria-label].help {
  background-image: url("data:image/svg+xml,%3csvg%20width='6'%20height='9'%20viewBox='0%200%206%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20y='1'%20width='2'%20height='2'%20fill='black'/%3e%3crect%20x='1'%20width='4'%20height='1'%20fill='black'/%3e%3crect%20x='4'%20y='1'%20width='2'%20height='2'%20fill='black'/%3e%3crect%20x='3'%20y='3'%20width='2'%20height='1'%20fill='black'/%3e%3crect%20x='2'%20y='4'%20width='2'%20height='2'%20fill='black'/%3e%3crect%20x='2'%20y='7'%20width='2'%20height='2'%20fill='black'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: top 2px left 5px;
}

.title-bar-controls button[aria-label='Close'],
.title-bar-controls button[aria-label].close {
  margin-left: 2px;
  background-image: url("data:image/svg+xml,%3csvg%20width='8'%20height='7'%20viewBox='0%200%208%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H1H2V1H3V2H4H5V1H6V0H7H8V1H7V2H6V3H5V4H6V5H7V6H8V7H7H6V6H5V5H4H3V6H2V7H1H0V6H1V5H2V4H3V3H2V2H1V1H0V0Z'%20fill='black'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: top 3px left 4px;
}

.status-bar {
  margin: 0 1px;
  display: flex;
  gap: 1px;
}

.status-bar-field {
  box-shadow: var(--border-status-field);
  flex-grow: 1;
  padding: 2px 3px;
  margin: 0;
}

.window-body {
  margin: var(--element-spacing);
}

fieldset {
  border-image: url("data:image/svg+xml,%3csvg%20width='5'%20height='5'%20viewBox='0%200%205%205'%20fill='grey'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H5V5H0V2H2V3H3V2H0'%20fill='white'%20/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H4V4H0V1H1V3H3V1H0'%20fill='%23808080'%20/%3e%3c/svg%3e") 2;
  padding: calc(2 * var(--border-width) + var(--element-spacing));
  padding-block-start: var(--element-spacing);
  margin: 0;
}

legend {
  background: var(--surface);
}

.field-row {
  display: flex;
  align-items: center;
  gap: var(--grouped-element-spacing);
}

[class^='field-row'] + [class^='field-row'] {
  margin-top: var(--grouped-element-spacing);
}

.field-row > * + * {
  margin-left: var(--grouped-element-spacing);
}

.field-row-stacked {
  display: flex;
  flex-direction: column;
}

.field-row-stacked * + * {
  margin-top: var(--grouped-element-spacing);
}

label {
  display: inline-flex;
  align-items: center;
  user-select: none;
}

input[type='radio'],
input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  background: 0;
  position: fixed;
  opacity: 0;
  border: none;
}

input[type='radio'] + label,
input[type='checkbox'] + label {
  line-height: 13px;
}

input[type='radio'] + label {
  position: relative;
  margin-left: var(--radio-total-width);
}

input[type='radio'] + label::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-1 * (var(--radio-total-width-precalc)));
  display: inline-block;
  width: var(--radio-width);
  height: var(--radio-width);
  margin-right: var(--radio-label-spacing);
  background: url("data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%200H4V1H2V2H1V4H0V8H1V10H2V8H1V4H2V2H4V1H8V2H10V1H8V0Z'%20fill='%23808080'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%201H4V2H2V3V4H1V8H2V9H3V8H2V4H3V3H4V2H8V3H10V2H8V1Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%203H10V4H9V3ZM10%208V4H11V8H10ZM8%2010V9H9V8H10V9V10H8ZM4%2010V11H8V10H4ZM4%2010V9H2V10H4Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%202H10V4H11V8H10V10H8V11H4V10H2V11H4V12H8V11H10V10H11V8H12V4H11V2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202H8V3H9V4H10V8H9V9H8V10H4V9H3V8H2V4H3V3H4V2Z'%20fill='white'/%3e%3c/svg%3e");
}

input[type='radio']:active + label::before {
  background: url("data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%200H4V1H2V2H1V4H0V8H1V10H2V8H1V4H2V2H4V1H8V2H10V1H8V0Z'%20fill='%23808080'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%201H4V2H2V3V4H1V8H2V9H3V8H2V4H3V3H4V2H8V3H10V2H8V1Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%203H10V4H9V3ZM10%208V4H11V8H10ZM8%2010V9H9V8H10V9V10H8ZM4%2010V11H8V10H4ZM4%2010V9H2V10H4Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%202H10V4H11V8H10V10H8V11H4V10H2V11H4V12H8V11H10V10H11V8H12V4H11V2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202H8V3H9V4H10V8H9V9H8V10H4V9H3V8H2V4H3V3H4V2Z'%20fill='%23C0C0C0'/%3e%3c/svg%3e");
}

input[type='radio']:checked + label::after {
  content: '';
  display: block;
  width: var(--radio-dot-width);
  height: var(--radio-dot-width);
  top: var(--radio-dot-top);
  left: var(--radio-dot-left);
  position: absolute;
  background: url("data:image/svg+xml,%3csvg%20width='4'%20height='4'%20viewBox='0%200%204%204'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%200H1V1H0V2V3H1V4H3V3H4V2V1H3V0Z'%20fill='black'/%3e%3c/svg%3e");
}

input[type='radio']:focus + label,
input[type='checkbox']:focus + label {
  outline: 1px dotted #000000;
}

input[type='radio'][disabled] + label::before {
  background: url("data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%200H4V1H2V2H1V4H0V8H1V10H2V8H1V4H2V2H4V1H8V2H10V1H8V0Z'%20fill='%23808080'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%201H4V2H2V3V4H1V8H2V9H3V8H2V4H3V3H4V2H8V3H10V2H8V1Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%203H10V4H9V3ZM10%208V4H11V8H10ZM8%2010V9H9V8H10V9V10H8ZM4%2010V11H8V10H4ZM4%2010V9H2V10H4Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%202H10V4H11V8H10V10H8V11H4V10H2V11H4V12H8V11H10V10H11V8H12V4H11V2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202H8V3H9V4H10V8H9V9H8V10H4V9H3V8H2V4H3V3H4V2Z'%20fill='%23C0C0C0'/%3e%3c/svg%3e");
}

input[type='radio'][disabled]:checked + label::after {
  background: url("data:image/svg+xml,%3csvg%20width='4'%20height='4'%20viewBox='0%200%204%204'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%200H1V1H0V2V3H1V4H3V3H4V2V1H3V0Z'%20fill='%23808080'/%3e%3c/svg%3e");
}

input[type='checkbox'] + label {
  position: relative;
  margin-left: var(--checkbox-total-width);
}

input[type='checkbox'] + label::before {
  content: '';
  position: absolute;
  left: calc(-1 * (var(--checkbox-total-width-precalc)));
  display: inline-block;
  width: var(--checkbox-width);
  height: var(--checkbox-width);
  background: var(--button-highlight);
  box-shadow: var(--border-field);
  margin-right: var(--radio-label-spacing);
}

input[type='checkbox']:active + label::before {
  background: var(--surface);
}

input[type='checkbox']:checked + label::after {
  content: '';
  display: block;
  width: var(--checkmark-width);
  height: var(--checkmark-width);
  position: absolute;
  left: calc(-1 * (var(--checkbox-total-width-precalc)) + var(--checkmark-left));
  background: url("data:image/svg+xml,%3csvg%20width='7'%20height='7'%20viewBox='0%200%207%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7%200H6V1H5V2H4V3H3V4H2V3H1V2H0V5H1V6H2V7H3V6H4V5H5V4H6V3H7V0Z'%20fill='black'/%3e%3c/svg%3e");
}

input[type='checkbox'][disabled] + label::before {
  background: var(--surface);
}

input[type='checkbox'][disabled]:checked + label::after {
  background: url("data:image/svg+xml,%3csvg%20width='7'%20height='7'%20viewBox='0%200%207%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7%200H6V1H5V2H4V3H3V4H2V3H1V2H0V5H1V6H2V7H3V6H4V5H5V4H6V3H7V0Z'%20fill='%23808080'/%3e%3c/svg%3e");
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='url'],
input[type='tel'],
input[type='number'],
input[type='search'],
select,
textarea {
  padding: 8px 4px;
  border: none;
  box-shadow: var(--border-field);
  background-color: var(--button-highlight);
  appearance: none;
  border-radius: 0;
}

/* clears the ‘X’ from Chrome */
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
  display: none;
}

input[type='email']:disabled,
input[type='url']:disabled,
input[type='tel']:disabled,
input[type='password']:disabled,
input[type='text']:disabled,
input[type='number']:disabled,
input[type='search']:disabled,
input[type='email']:read-only,
input[type='url']:read-only,
input[type='tel']:read-only,
input[type='password']:read-only,
input[type='text']:read-only,
input[type='number']:read-only,
input[type='search']:read-only,
textarea:disabled {
  background-color: var(--surface);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%200H0V1V16H1V1H15V0Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%201H1V15H2V2H14V1H2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%2017H15H0V16H15V0H16V17Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%201H14V15H1V16H14H15V1Z'%20fill='%23808080'/%3e%3crect%20x='2'%20y='2'%20width='12'%20height='13'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%206H4V7H5V8H6V9H7V10H8V9H9V8H10V7H11V6Z'%20fill='black'/%3e%3c/svg%3e");
  background-position: top 2px right 2px;
  background-repeat: no-repeat;
  border-radius: 0;
}

select:focus,
input[type='text']:focus,
input[type='password']:focus,
input[type='email']:focus,
input[type='url']:focus,
input[type='tel']:focus,
input[type='number']:focus,
input[type='search']:focus,
textarea:focus {
  outline: none;
}

input[type='range'] {
  appearance: none;
  width: 100%;
  background: transparent;
}

input[type='range']:focus {
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  height: 21px;
  width: 11px;
  background: url("data:image/svg+xml,%3csvg%20width='11'%20height='21'%20viewBox='0%200%2011%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200V16H2V18H4V20H5V19H3V17H1V1H10V0Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%201V16H2V17H3V18H4V19H6V18H7V17H8V16H9V1Z'%20fill='%23C0C7C8'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%201H10V16H8V18H6V20H5V19H7V17H9Z'%20fill='%2387888F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%200H11V16H9V18H7V20H5V21H6V19H8V17H10Z'%20fill='black'/%3e%3c/svg%3e");
  transform: translateY(-8px);
  box-shadow: none;
  border: none;
}

input[type='range'].has-box-indicator::-webkit-slider-thumb {
  background: url("data:image/svg+xml,%3csvg%20width='11'%20height='21'%20viewBox='0%200%2011%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200V20H1V1H10V0Z'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='8'%20height='18'%20fill='%23C0C7C8'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%201H10V20H1V19H9Z'%20fill='%2387888F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%200H11V21H0V20H10Z'%20fill='black'/%3e%3c/svg%3e");
  transform: translateY(-10px);
}

input[type='range']::-moz-range-thumb {
  height: 21px;
  width: 11px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3csvg%20width='11'%20height='21'%20viewBox='0%200%2011%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200V16H2V18H4V20H5V19H3V17H1V1H10V0Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%201V16H2V17H3V18H4V19H6V18H7V17H8V16H9V1Z'%20fill='%23C0C7C8'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%201H10V16H8V18H6V20H5V19H7V17H9Z'%20fill='%2387888F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%200H11V16H9V18H7V20H5V21H6V19H8V17H10Z'%20fill='black'/%3e%3c/svg%3e");
  transform: translateY(2px);
}

input[type='range'].has-box-indicator::-moz-range-thumb {
  background: url("data:image/svg+xml,%3csvg%20width='11'%20height='21'%20viewBox='0%200%2011%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200V20H1V1H10V0Z'%20fill='white'/%3e%3crect%20x='1'%20y='1'%20width='8'%20height='18'%20fill='%23C0C7C8'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%201H10V20H1V19H9Z'%20fill='%2387888F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%200H11V21H0V20H10Z'%20fill='black'/%3e%3c/svg%3e");
  transform: translateY(0);
}

input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 2px;
  box-sizing: border-box;
  background: black;
  border-right: 1px solid grey;
  border-bottom: 1px solid grey;
  box-shadow: 1px 0 0 white, 1px 1px 0 white, 0 1px 0 white, -1px 0 0 darkgrey, -1px -1px 0 darkgrey, 0 -1px 0 darkgrey,
    -1px 1px 0 white, 1px -1px darkgrey;
}

input[type='range']::-moz-range-track {
  width: 100%;
  height: 2px;
  box-sizing: border-box;
  background: black;
  border-right: 1px solid grey;
  border-bottom: 1px solid grey;
  box-shadow: 1px 0 0 white, 1px 1px 0 white, 0 1px 0 white, -1px 0 0 darkgrey, -1px -1px 0 darkgrey, 0 -1px 0 darkgrey,
    -1px 1px 0 white, 1px -1px darkgrey;
}

.is-vertical {
  display: inline-block;
  width: 4px;
  height: 150px;
  transform: translateY(50%);
}

.is-vertical > input[type='range'] {
  width: 150px;
  height: 4px;
  margin: 0 calc(var(--grouped-element-spacing) + var(--range-spacing)) 0 var(--range-spacing);
  transform-origin: left;
  transform: rotate(270deg) translateX(calc(-50% + var(--element-spacing)));
}

.is-vertical > input[type='range']::-webkit-slider-runnable-track {
  border-left: 1px solid grey;
  border-right: 0;
  border-bottom: 1px solid grey;
  box-shadow: -1px 0 0 white, -1px 1px 0 white, 0 1px 0 white, 1px 0 0 darkgrey, 1px -1px 0 darkgrey, 0 -1px 0 darkgrey,
    1px 1px 0 white, -1px -1px darkgrey;
}

.is-vertical > input[type='range']::-moz-range-track {
  border-left: 1px solid grey;
  border-right: 0;
  border-bottom: 1px solid grey;
  box-shadow: -1px 0 0 white, -1px 1px 0 white, 0 1px 0 white, 1px 0 0 darkgrey, 1px -1px 0 darkgrey, 0 -1px 0 darkgrey,
    1px 1px 0 white, -1px -1px darkgrey;
}

.is-vertical > input[type='range']::-webkit-slider-thumb {
  transform: translateY(-8px) scaleX(-1);
}

.is-vertical > input[type='range'].has-box-indicator::-webkit-slider-thumb {
  transform: translateY(-10px) scaleX(-1);
}

.is-vertical > input[type='range']::-moz-range-thumb {
  transform: translateY(2px) scaleX(-1);
}

.is-vertical > input[type='range'].has-box-indicator::-moz-range-thumb {
  transform: translateY(0) scaleX(-1);
}

select:focus {
  color: var(--button-highlight);
  background-color: var(--dialog-blue);
}
select:focus option {
  color: #000;
  background-color: #fff;
}

select:active {
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%200H15H16V17H15H0V16V1V0ZM1%2016H15V1H1V16Z'%20fill='%23808080'/%3e%3crect%20x='1'%20y='1'%20width='14'%20height='15'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%207H5V8H6V9H7V10H8V11H9V10H10V9H11V8H12V7Z'%20fill='black'/%3e%3c/svg%3e");
}

a {
  color: var(--link-blue);
}

a:focus {
  outline: 1px dotted var(--link-blue);
}

ul.tree-view {
  display: block;
  background: var(--button-highlight);
  box-shadow: var(--border-field);
  padding: 6px;
  margin: 0;
}

ul.tree-view li {
  list-style-type: none;
}

ul.tree-view a {
  text-decoration: none;
  color: #000;
}

ul.tree-view a:focus {
  background-color: var(--dialog-blue);
  color: var(--button-highlight);
}

ul.tree-view ul,
ul.tree-view li {
  margin-top: 3px;
}

ul.tree-view ul {
  margin-left: 16px;
  padding-left: 16px;
  /* Goes down too far */
  border-left: 1px dotted #808080;
}

ul.tree-view ul > li {
  position: relative;
}
ul.tree-view ul > li::before {
  content: '';
  display: block;
  position: absolute;
  left: -16px;
  top: 6px;
  width: 12px;
  border-bottom: 1px dotted #808080;
}

/* Cover the bottom of the left dotted border */
ul.tree-view ul > li:last-child::after {
  content: '';
  display: block;
  position: absolute;
  left: -20px;
  top: 7px;
  bottom: 0;
  width: 8px;
  background: var(--button-highlight);
}

ul.tree-view details {
  margin-top: 0;
}

ul.tree-view details[open] summary {
  margin-bottom: 0;
}

ul.tree-view ul details > summary:before {
  margin-left: -22px;
  position: relative;
  z-index: 1;
}

ul.tree-view details > summary:before {
  text-align: center;
  display: block;
  float: left;
  content: '+';
  border: 1px solid #808080;
  width: 8px;
  height: 9px;
  line-height: 8px;
  margin-right: 5px;
  padding-left: 1px;
  background-color: #fff;
}

ul.tree-view details[open] > summary:before {
  content: '-';
}

ul.tree-view details > summary::marker,
ul.tree-view details > summary::-webkit-details-marker {
  content: '';
}

pre {
  display: block;
  background: var(--button-highlight);
  box-shadow: var(--border-field);
  padding: 12px 8px;
  margin: 0;
}

code,
code * {
  font-family: monospace;
}

summary:focus {
  outline: 1px dotted #000000;
}

::-webkit-scrollbar {
  width: 16px;
}
::-webkit-scrollbar:horizontal {
  height: 17px;
}

::-webkit-scrollbar-corner {
  background: var(--button-face);
}

::-webkit-scrollbar-track {
  background-image: url("data:image/svg+xml,%3csvg%20width='2'%20height='2'%20viewBox='0%200%202%202'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%200H0V1H1V2H2V1H1V0Z'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%200H1V1H0V2H1V1H2V0Z'%20fill='white'/%3e%3c/svg%3e");
}

::-webkit-scrollbar-thumb {
  background-color: var(--button-face);
  box-shadow: var(--border-raised-outer), var(--border-raised-inner);
}

::-webkit-scrollbar-button:horizontal:start:decrement,
::-webkit-scrollbar-button:horizontal:end:increment,
::-webkit-scrollbar-button:vertical:start:decrement,
::-webkit-scrollbar-button:vertical:end:increment {
  display: block;
}

::-webkit-scrollbar-button:vertical:start {
  height: 17px;
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%200H0V1V16H1V1H15V0Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%201H1V15H2V2H14V1H2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%2017H15H0V16H15V0H16V17Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%201H14V15H1V16H14H15V1Z'%20fill='%23808080'/%3e%3crect%20x='2'%20y='2'%20width='12'%20height='13'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%206H7V7H6V8H5V9H4V10H11V9H10V8H9V7H8V6Z'%20fill='black'/%3e%3c/svg%3e");
}
::-webkit-scrollbar-button:vertical:end {
  height: 17px;
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%200H0V1V16H1V1H15V0Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%201H1V15H2V2H14V1H2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%2017H15H0V16H15V0H16V17Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%201H14V15H1V16H14H15V1Z'%20fill='%23808080'/%3e%3crect%20x='2'%20y='2'%20width='12'%20height='13'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%206H4V7H5V8H6V9H7V10H8V9H9V8H10V7H11V6Z'%20fill='black'/%3e%3c/svg%3e");
}
::-webkit-scrollbar-button:horizontal:start {
  width: 16px;
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%200H0V1V16H1V1H15V0Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%201H1V15H2V2H14V1H2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%2017H15H0V16H15V0H16V17Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%201H14V15H1V16H14H15V1Z'%20fill='%23808080'/%3e%3crect%20x='2'%20y='2'%20width='12'%20height='13'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%204H8V5H7V6H6V7H5V8H6V9H7V10H8V11H9V4Z'%20fill='black'/%3e%3c/svg%3e");
}
::-webkit-scrollbar-button:horizontal:end {
  width: 16px;
  background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%200H0V1V16H1V1H15V0Z'%20fill='%23DFDFDF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%201H1V15H2V2H14V1H2Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%2017H15H0V16H15V0H16V17Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15%201H14V15H1V16H14H15V1Z'%20fill='%23808080'/%3e%3crect%20x='2'%20y='2'%20width='12'%20height='13'%20fill='%23C0C0C0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7%204H6V11H7V10H8V9H9V8H10V7H9V6H8V5H7V4Z'%20fill='black'/%3e%3c/svg%3e");
}

.window[role='tabpanel'] {
  position: relative;
  z-index: 2;
}

menu[role='tablist'] {
  position: relative;
  margin: 0 0 -2px 0;
  text-indent: 0;
  list-style-type: none;
  display: flex;
  padding-left: 3px;
}

menu[role='tablist'] > li {
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  box-shadow: var(--border-tab);
  z-index: 1;
}

menu[role='tablist'] > li[aria-selected='true'] {
  padding-bottom: 2px;
  margin-top: -2px;
  background-color: var(--surface);
  position: relative;
  z-index: 8;
  margin-left: -3px;
}

menu[role='tablist'] > li > a {
  display: block;
  color: #222;
  margin: 6px;
  text-decoration: none;
}
menu[role='tablist'] > li[aria-selected='true'] > a:focus {
  outline: none;
}
menu[role='tablist'] > li > a:focus {
  outline: 1px dotted #222;
}

menu[role='tablist'].multirows > li {
  flex-grow: 1;
  text-align: center;
}
.sunken-panel {
  box-sizing: border-box;
  border: 2px groove transparent;
  border-image: url("data:image/svg+xml,%3csvg%20width='5'%20height='5'%20viewBox='0%200%205%205'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='4'%20height='1'%20x='0'%20y='0'%20fill='%23808080'/%3e%3crect%20width='1'%20height='4'%20x='0'%20y='0'%20fill='%23808080'/%3e%3crect%20width='2'%20height='1'%20x='1'%20y='1'%20fill='%230a0a0a'/%3e%3crect%20width='1'%20height='2'%20x='1'%20y='1'%20fill='%230a0a0a'/%3e%3crect%20width='5'%20height='1'%20x='0'%20y='4'%20fill='%23fff'/%3e%3crect%20width='1'%20height='5'%20x='4'%20y='0'%20fill='%23fff'/%3e%3crect%20width='1'%20height='3'%20x='3'%20y='1'%20fill='%23dfdfdf'/%3e%3crect%20width='3'%20height='1'%20x='1'%20y='3'%20fill='%23dfdfdf'/%3e%3c/svg%3e") 2;
  overflow: auto;
  background-color: #fff;
}

table {
  border-collapse: collapse;
  position: relative;
  text-align: left;
  white-space: nowrap;
  background-color: #fff;
  width: 100%;
}

table > thead > tr > * {
  position: sticky;
  top: 0;
  box-shadow: var(--border-raised-outer), var(--border-raised-inner);
  background: var(--surface);
  font-weight: normal;
  padding: 4px var(--grouped-element-spacing);
}

table.interactive > tbody > tr {
  cursor: pointer;
}

table > tbody > tr.highlighted {
  color: #fff;
  background-color: var(--dialog-blue);
}

table > tbody > tr > * {
  padding: 2px var(--grouped-element-spacing);
}

.progress-indicator {
  height: 32px;
  position: relative;
  box-shadow: var(--border-sunken-inner);
  padding: 4px 4px;
  border: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

.progress-indicator > .progress-indicator-bar {
  height: 100%;
  display: block;
  background-color: var(--dialog-blue);
}

.progress-indicator.segmented > .progress-indicator-bar {
  width: 100%;
  background-color: transparent; /* resets the background color which is set to blue in the non-segmented selector */
  background-image: linear-gradient(90deg, var(--dialog-blue) 0 16px, transparent 0 2px);
  background-repeat: repeat;
  background-size: 18px 100%;
}

.field-border {
  background: var(--button-highlight);
  box-shadow: var(--border-field);
  padding: 2px;
}

.field-border-disabled {
  background: var(--surface);
  box-shadow: var(--border-field);
  padding: 2px;
}

.status-field-border {
  background: var(--surface);
  box-shadow: var(--border-status-field);
  padding: 1px;
}

.menu-bar {
  display: flex;
}

.menu-bar .menu-bar-item {
  position: relative;
}

.menu-bar .menu-bar-item > button {
  box-shadow: none;
  min-height: 20px;
  min-width: auto;
  outline: none;
  padding: 0 6px;
}

.menu-bar .menu-bar-item > button:active,
.menu-bar .menu-bar-item > button:focus {
  box-shadow: inset -1px -1px #fff, inset 0 0 #0a0a0a, inset -1px -1px #dfdfdf, inset 1px 1px grey;
  text-shadow: 0 0 #222;
}

/*
 * Keep the dropdown open while the menubar button or any item inside has focus.
 * Script-driven <li data-menu-action> items must be focused on mousedown (see appMenuChrome.ts);
 * otherwise the menu hides before the click completes.
 */
.menu-bar .menu-bar-item:focus-within > .menu,
.menu-bar .menu-bar-item > button:focus + .menu {
  display: block;
}

ul.menu > li[data-menu-action] {
  cursor: default;
}

ul.menu > li[data-menu-action]:focus {
  background: var(--dialog-blue);
  color: #fff;
  outline: none;
}

.window-body.frame {
  margin: 2px;
}

ul.menu {
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
  display: none;
  list-style-type: none;
  margin: 0;
  min-width: 100px;
  padding: 2px;
  position: absolute;
  z-index: 100;
  width: max-content;
}

ul.menu > li:not(.divider) {
  cursor: default;
  padding: 3px 20px 3px 20px;
}

ul.menu > li > a {
  color: inherit;
  display: block;
  margin: -3px -20px;
  padding: 3px 20px;
  text-decoration: none;
}

ul.menu li:not(.disabled):not(.divider):hover {
  background: var(--dialog-blue);
  color: #fff;
}

ul.menu li.disabled {
  color: var(--button-shadow);
}

ul.menu li.divider {
  border-bottom: 1px solid #dfdfdf;
  border-top: 1px solid grey;
  margin: 2px;
}

ul.menu li > span {
  float: right;
  margin-left: 10px;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body {
  background: #008081;
  font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Tahoma, Geneva, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.25rem;
}

/* Full-page 98.css window (see https://jdan.github.io/98.css/#window) */
.app-page {
  min-height: 100vh;
  width: 100%;
}

.app-window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

html:fullscreen .app-page {
  padding: 0;
  min-height: 100%;
  height: 100%;
  width: 100%;
}

html:fullscreen .app-window {
  height: 100%;
}

.app-window-body {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-window-body > #game-shell,
.app-window-body > .hotseat-playfield {
  flex: 1 1 auto;
  min-height: 0;
}

.app-page--hotseat .hotseat-playfield {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 0;
}

.hotseat-pane {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #808080;
}

.hotseat-pane:last-child {
  border-right: none;
}

.motor-pool-host {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.motor-pool--pane {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.game-shell--pane {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.game-canvas-host {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.game-canvas-host canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.bottom-hud-host {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.bottom-hud--pane {
  position: relative;
  width: 100%;
}

.app-window-body > .start-screen {
  position: absolute;
  inset: 0;
  z-index: 0;
  height: auto;
  width: auto;
}

.app-window-body .hud,
.app-window-body .motor-pool,
.app-window-body .game-end,
.app-window-body .death-overlay,
.app-window-body .motor-pool-map-dialog-host,
.app-window-body .quit-screen {
  position: absolute;
}

#renderCanvas,
#app canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.game-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#game-shell[hidden] {
  display: none !important;
}

#app {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

:root {
  --bottom-hud-height: auto;
  --bottom-hud-bunker-max-width: 640px;
  --motor-pool-design-width: 320px;
  --motor-pool-design-height: 200px;

  --motor-pool-sky-height: 68px;
  --motor-pool-horizon-top: var(--motor-pool-sky-height);
  --motor-pool-horizon-height: 68px;
  --motor-pool-ground-top: calc(var(--motor-pool-sky-height) + var(--motor-pool-horizon-height));

  --motor-pool-hazard-top: var(--motor-pool-sky-height);

  --motor-pool-bg-sky-color: #57a8b3;
  --motor-pool-bg-clouds: url('/tiles/2087.png');
  --motor-pool-bg-clouds-size: 192px 100%;
  --motor-pool-bg-horizon: url('/tiles/2085.png');
  --motor-pool-bg-horizon-size: 128px 100%;
  --motor-pool-bg-ground: url('/tiles/2080.png');
  --motor-pool-bg-ground-size: 96px 96px;
  --motor-pool-tile-elevator-shaft: url('/tiles/2079.png');
  --motor-pool-tile-bay-led-0: url('/tiles/2092.png');
  --motor-pool-tile-bay-led-1: url('/tiles/2093.png');
  --motor-pool-tile-bay-led-2: url('/tiles/2091.png');
  --motor-pool-tile-readout: url('/tiles/1942.png');

  --motor-pool-structure-stack-width: 164px;
  --motor-pool-structure-top: 35px;

  --motor-pool-bay-width: 42px;
  --motor-pool-bay-height: 28px;
  --motor-pool-bay-top-row-top: 96px;
  --motor-pool-bay-bottom-row-top: 144px;
  --motor-pool-bay-left-inset: 16px;
  --motor-pool-bay-right-inset: 14px;

  --motor-pool-elevator-width: 32px;
  --motor-pool-vehicle-bottom: 4%;

  --motor-pool-lift-center-x: 51%;
  --motor-pool-lift-height-home: 30px;
  --motor-pool-lift-height-half: 76px;
  --motor-pool-lift-height-grown: 144px;

  --motor-pool-bay-led-bottom: -4px;
  --motor-pool-bay-led-width: 40px;
  --motor-pool-bay-led-height: 2px;

  --motor-pool-lift-duration: 1s;
  --motor-pool-vehicle-board-duration: 0.9s;
  --motor-pool-scene-core-max: 640px;
}

#motor-pool-root {
  width: 100%;
  height: 100%;
}

/* Plain 2D motor pool (underground only — no 3D): overlays canvas in singleplayer; full-screen when both players underground */
.motor-pool {
  position: fixed;
  z-index: 4;
  /* pointer-events: none; */
  /* user-select: none; */
  display: none;
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--motor-pool-bg-sky-color, #57a8b3);
}

.motor-pool--full {
  inset: 0;
  width: 100%;
  height: 100%;
}

.motor-pool--split {
  inset: 0;
  width: 100%;
  height: 100%;
}

.motor-pool--left {
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
}

.motor-pool--right {
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
}

.motor-pool__inner,
.motor-pool__split {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.motor-pool__stage {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  background-color: #636884;
  background-image: url('/ui/bunker-1p-repeat.jpg');
  background-repeat: repeat-x;
  background-position: center bottom;
}

.motor-pool__scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.motor-pool__scene-core {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: var(--motor-pool-scene-core-max);
  top: 0;
  margin: 0 auto;
}

.motor-pool--left .motor-pool__scene-core,
.motor-pool--right .motor-pool__scene-core {
  max-width: none;
  padding-inline: 8px;
}

.motor-pool__hud {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--motor-pool-scene-core-max);
  margin: 0 auto;
  height: 212px;
}

.motor-pool--left .motor-pool__hud,
.motor-pool--right .motor-pool__hud {
  max-width: none;
  padding-inline: 8px;
}

.motor-pool__hud--1p,
.motor-pool__hud--2p {
  aspect-ratio: 640 / 212;
}

.motor-pool__monitor-frame {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  top: 34px;
  width: 296px;
  height: 148px;
  left: 168px;
}

.motor-pool__monitor,
.vehicle-hud__monitor {
  position: absolute;
  z-index: 3;
  overflow: hidden;
  top: 54px;
  width: 240px;
  height: 112px;
  left: 196px;
}

.vehicle-hud__monitor {
  top: 38px;
  width: 285px;
  height: 138px;
  left: 174px;
  transform-origin: center bottom;
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes vehicle-hud-monitor-enter {
    from {
      transform: translateY(calc(100% + 20px));
      opacity: 0.88;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .vehicle-hud__monitor.vehicle-hud__monitor--entering {
    animation: vehicle-hud-monitor-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

.motor-pool__shell {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  gap: 0;
}

.motor-pool__shell .motor-pool__inner {
  flex: 1;
  min-width: 0;
}

.motor-pool__rail {
  flex: 0 0 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.motor-pool__rail-img {
  display: block;
  width: 24px;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
}

.motor-pool__chrome {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  line-height: 0;
}

.motor-pool__chrome-img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.motor-pool__split {
  gap: 8px;
}

/* Bunker scene + HUD monitors (tile composite 320×200, tiles 2075–2101). */
.motor-pool__art {
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: var(--motor-pool-scene-core-max);
  max-height: 100%;
  overflow: hidden;
  aspect-ratio: 320 / 200;
  image-rendering: pixelated;
}

.motor-pool__tiles-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

.motor-pool__art-stage {
  position: relative;
  z-index: 1;
  width: var(--motor-pool-design-width);
  height: var(--motor-pool-design-height);
  transform: scale(calc(100cqw / var(--motor-pool-design-width)));
  transform-origin: top left;
  image-rendering: pixelated;
}

.motor-pool__tiles-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--motor-pool-sky-height);
  background-color: var(--motor-pool-bg-sky-color, #57a8b3);
}

.motor-pool__tiles-clouds {
  position: absolute;
  inset: 0;
  background-image: var(--motor-pool-bg-clouds);
  background-size: var(--motor-pool-bg-clouds-size);
  background-repeat: repeat-x;
  image-rendering: pixelated;
}

.motor-pool__tiles-horizon {
  position: absolute;
  top: var(--motor-pool-horizon-top);
  left: 0;
  right: 0;
  height: var(--motor-pool-horizon-height);
  background-color: #573c1d;
  background-image: var(--motor-pool-bg-horizon);
  background-size: var(--motor-pool-bg-horizon-size);
  background-repeat: repeat-x;
  image-rendering: pixelated;
}

.motor-pool__tiles-ground {
  position: absolute;
  top: var(--motor-pool-ground-top);
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--motor-pool-bg-ground);
  background-size: var(--motor-pool-bg-ground-size);
  background-repeat: repeat;
  image-rendering: pixelated;
}

.motor-pool__art .motor-pool__tiles-hazard {
  position: absolute;
  left: 50%;
  top: var(--motor-pool-hazard-top);
  z-index: 2;
  width: 20%;
  height: 16%;
  transform: translateX(-50%);
  background-image: url('/tiles/2084.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center bottom;
  image-rendering: pixelated;
  pointer-events: none;
}

.motor-pool__structure-stack {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: var(--motor-pool-structure-stack-width);
  height: 100%;
}

.motor-pool__tiles-structure {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  position: absolute;
  top: var(--motor-pool-structure-top);
  transform-origin: center center;
}

.motor-pool__elevator {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.motor-pool__elevator-lift {
  position: absolute;
  bottom: 0;
  left: var(--motor-pool-lift-center-x);
  width: var(--motor-pool-elevator-width);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: var(--motor-pool-lift-height-home);
  image-rendering: pixelated;
  will-change: height;
  transition: height var(--motor-pool-lift-duration) linear;
}

.motor-pool__elevator-lift.grown {
  height: var(--motor-pool-lift-height-grown);
}

.motor-pool__elevator-lift.half-grown {
  height: var(--motor-pool-lift-height-half);
}

.motor-pool__elevator-shaft {
  flex-grow: 1;
  width: 100%;
  background-image: var(--motor-pool-tile-elevator-shaft);
  background-size: contain;
  background-repeat: repeat-y;
  background-position: center;
}

.motor-pool__elevator--carrying {
  z-index: 3;
}

.motor-pool__elevator-lift--carrying,
.motor-pool__elevator-lift.half-grown,
.motor-pool__elevator-lift.grown {
  overflow: visible;
}

.motor-pool__elevator-platform {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  overflow: visible;
}

.motor-pool__elevator-platform__tile {
  display: block;
  width: var(--motor-pool-elevator-width);
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

.motor-pool__elevator-platform .motor-pool__vehicle--on-platform {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  z-index: 2;
  transition: none;
}

.motor-pool__slots-abs {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.motor-pool__vehicle {
  position: absolute;
  left: 50%;
  bottom: var(--motor-pool-vehicle-bottom);
  width: auto;
  height: auto;
  max-width: var(--motor-pool-bay-width);
  max-height: var(--motor-pool-bay-height);
  object-fit: contain;
  image-rendering: pixelated;
  transform: translateX(-50%);
  z-index: 2;
  transition: transform var(--motor-pool-vehicle-board-duration) linear;
}

@keyframes motor-pool-bay-led-anim {
  0%,
  33.32% {
    background-image: var(--motor-pool-tile-bay-led-0);
  }
  33.33%,
  66.65% {
    background-image: var(--motor-pool-tile-bay-led-1);
  }

  66.66%,
  100% {
    background-image: var(--motor-pool-tile-bay-led-2);
  }
}

.motor-pool__bay-leds {
  position: absolute;
  right: 0;
  bottom: var(--motor-pool-bay-led-bottom);
  width: var(--motor-pool-bay-led-width);
  height: var(--motor-pool-bay-led-height);
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
  animation: motor-pool-bay-led-anim 0.9s steps(1) infinite;
}

.motor-pool__slot--bay {
  position: absolute;
  border: none;
  background: transparent;
  border-radius: 8px;
}

.motor-pool__slot--bay::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(70, 100, 120, 0.08);
  transition: background 0.35s ease;
  z-index: 0;
}

.motor-pool__slot--tl,
.motor-pool__slot--tr,
.motor-pool__slot--bl,
.motor-pool__slot--br {
  width: var(--motor-pool-bay-width);
  height: var(--motor-pool-bay-height);
}

.motor-pool__slot--tl,
.motor-pool__slot--tr {
  top: var(--motor-pool-bay-top-row-top);
}

.motor-pool__slot--tl,
.motor-pool__slot--bl {
  left: var(--motor-pool-bay-left-inset);
}

.motor-pool__slot--tr,
.motor-pool__slot--br {
  right: var(--motor-pool-bay-right-inset);
}

.motor-pool__slot--bl,
.motor-pool__slot--br {
  top: var(--motor-pool-bay-bottom-row-top);
}

@keyframes motor-pool-spot-pulse {
  from {
    opacity: 0.82;
  }
  to {
    opacity: 1;
  }
}

.motor-pool__slot--bay.motor-pool__slot--lit::before {
  background: rgba(6, 18, 36, 0.2);
}

.motor-pool__slot--bay.motor-pool__slot--lit::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 50px;
  height: 24px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: radial-gradient(
      ellipse 24% 9% at 50% 2.5%,
      rgba(240, 252, 255, 1) 0%,
      rgba(195, 230, 255, 0.55) 48%,
      transparent 74%
    ),
    linear-gradient(
      180deg,
      rgba(218, 240, 255, 0.45) 0%,
      rgba(175, 215, 255, 0.2) 38%,
      rgba(115, 180, 255, 0.06) 65%,
      transparent 93%
    );
  mix-blend-mode: screen;
  animation: motor-pool-spot-pulse 2.1s ease-in-out infinite alternate;
}

.motor-pool__slot--br,
.motor-pool__slot--tr {
  --vehicle-board-x: calc(var(--motor-pool-bay-width) * -1);
}

.motor-pool__slot--bl,
.motor-pool__slot--tl {
  --vehicle-board-x: var(--motor-pool-bay-width);
}

.motor-pool__slot--bay.motor-pool__slot--empty::before {
  background: rgba(0, 0, 0, 0.72);
}

.motor-pool__slot--bay.motor-pool__slot--empty.motor-pool__slot--lit::after {
  opacity: 0.65;
}

.motor-pool__slot--bay.motor-pool__slot--deploying {
  z-index: 4;
}

.motor-pool__slot--bay.motor-pool__slot--deploying .motor-pool__vehicle--boarding {
  transform: translate(calc(-50% + var(--vehicle-board-x)), 0);
  z-index: 5;
}

/* Stock readout panel under the bunker art (matches 2×2 bay layout). */
.motor-pool__readout {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px 6px;
  border-radius: 0;
  background-image: var(--motor-pool-tile-readout);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
}

.motor-pool__read-slot {
  text-align: center;
  padding: 8px 6px 9px;
  border-radius: 6px;
  border: 1px solid rgba(75, 105, 128, 0.4);
  background: rgba(0, 0, 0, 0.28);
}

.motor-pool__read-slot--lit {
  border-color: rgba(130, 190, 240, 0.55);
  box-shadow: 0 0 16px rgba(90, 160, 255, 0.18), inset 0 0 20px rgba(80, 140, 200, 0.06);
}

.motor-pool__read-slot--tile-hud {
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.motor-pool__tile-readout {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.motor-pool__tile-readout__scene {
  position: relative;
  z-index: 0;
  width: 186px;
  height: 75px;
  transform-origin: center;
  image-rendering: pixelated;
}

.motor-pool__tile-readout__chrome {
  position: absolute;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 0;
}

.motor-pool__tile-readout__icon,
.motor-pool__tile-readout__digit,
.motor-pool__tile-readout__digits {
  position: absolute;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 1;
}

.motor-pool__read-slot--empty {
  opacity: 0.46;
}

/* When motor pool occupies the left half, keep overworld HUD on the right so it stays readable */
body:has(.motor-pool--left) .hud {
  left: auto;
  right: 12px;
  text-align: right;
}

body:has(.motor-pool--left) .hud .hud__section,
body:has(.motor-pool--left) .hud .hud__head {
  text-align: right;
}

.hud {
  position: fixed;
  z-index: 2;
  left: 12px;
  top: 10px;
  max-width: min(680px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #e8e8ef;
  background: rgba(6, 8, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* pointer-events: none; */
  user-select: none;
}

.hud__head {
  margin-bottom: 8px;
}

.hud__ctx {
  color: #9ec8ff;
  font-weight: 600;
}

.hud__section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hud__section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.hud__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7dd3c0;
  margin-bottom: 6px;
}

.hud__section--field .hud__label {
  color: #9ec8ff;
}

.hud__field-line {
  margin: 3px 0;
}

.hud__stats {
  opacity: 0.95;
  font-size: 12px;
}

.hud__mp-nav {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.9;
}

.hud__keys-row {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.4;
}

.hud__keys-tag {
  display: inline-block;
  min-width: 2.5em;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8ab8b0;
}

.hud__meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  opacity: 0.92;
}

.hud__stalls {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.hud__slot {
  flex: 1;
  min-width: 0;
  padding: 6px 4px 7px;
  border: 1px solid rgba(80, 140, 130, 0.35);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.hud__slot--lit {
  border-color: rgba(255, 200, 120, 0.75);
  box-shadow: 0 0 10px rgba(255, 190, 100, 0.15), inset 0 0 16px rgba(255, 200, 100, 0.05);
  color: #fff8e8;
}

.hud__slot--empty {
  opacity: 0.45;
}

.hud__slot-name {
  display: block;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8ab8b0;
  margin-bottom: 2px;
}

.hud__slot--lit .hud__slot-name {
  color: #ffd8a8;
}

.hud__slot-n {
  font-size: 14px;
  font-weight: 700;
}

.hud__row {
  margin: 4px 0;
  font-size: 12px;
}

.hud__dim {
  opacity: 0.58;
}

.hud kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud .hint {
  margin-top: 6px;
  opacity: 0.75;
  font-size: 12px;
}

.hud code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Bottom status bar: ammo shells, fuel, HP, minimap */
.bottom-hud {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  user-select: none;
  background: transparent;
}

.bottom-hud:has(.player-strip__legacy:not([hidden])) {
  background: #636884;
}

.bottom-hud__panels {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.bottom-hud__panels--singleplayer {
  flex-direction: row;
}

.bottom-hud__panels--singleplayer .player-strip {
  flex: 1;
  min-width: 0;
}

.bottom-hud__panels--hotseat .player-strip {
  flex: 1;
  max-width: 640px;
}

.player-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 14, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e8eaf0;
  font-size: 12px;
}

.player-strip:has(.player-strip__vehicle:not([hidden])) {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 0;
}

.motor-pool-map-dialog-host {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.motor-pool-map-dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.motor-pool-map-dialog[hidden] {
  display: none !important;
}

.motor-pool-map-dialog__frame {
  position: relative;
  width: min(432px, 72vmin);
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  background: #737373;
}

.motor-pool-map-dialog__chrome {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.motor-pool-map-dialog__canvas {
  position: absolute;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.player-strip__vehicle[hidden],
.player-strip__legacy[hidden] {
  display: none !important;
}

.vehicle-hud {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
}

.vehicle-hud--bunker {
  width: 100%;
}

.vehicle-hud__bunker {
  position: relative;
  width: 100%;
  max-width: var(--bottom-hud-bunker-max-width);
  margin: 0 auto;
  padding: 0 0 4px;
}

.vehicle-hud__bunker.motor-pool__hud--1p {
  aspect-ratio: 640 / 212;
}

.vehicle-hud__monitor .vehicle-hud__scene {
  position: relative;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.vehicle-hud__chrome,
.vehicle-hud__minimap,
.vehicle-hud__damage-flash,
.vehicle-hud__ammo-selected,
.vehicle-hud__fuel-icon,
.vehicle-hud__grenade,
.vehicle-hud__beacon {
  image-rendering: pixelated;
}

.vehicle-hud__chrome {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vehicle-hud__minimap,
.vehicle-hud__damage-flash,
.vehicle-hud__ammo-selected,
.vehicle-hud__fuel-icon,
.vehicle-hud__fuel-bar,
.vehicle-hud__ammo-bar,
.vehicle-hud__grenade,
.vehicle-hud__beacon {
  position: absolute;
}

.vehicle-hud__minimap {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.vehicle-hud__damage-flash,
.vehicle-hud__ammo-selected {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vehicle-hud__beacon {
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
  opacity: 0.95;
}

.vehicle-hud__beacon--enemy {
  background: #3dff4a;
  box-shadow: 0 0 6px #3dff4a;
}

.vehicle-hud__beacon--bunker {
  background: #ff3b30;
  box-shadow: 0 0 6px #ff3b30;
}

.vehicle-hud__beacon[hidden],
.vehicle-hud__damage-flash[hidden],
.vehicle-hud__ammo-selected[hidden],
.vehicle-hud__grenade[hidden],
.vehicle-hud__minimap[hidden] {
  display: none !important;
}

.vehicle-hud__grenades {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vehicle-hud__grenades[hidden] {
  display: none !important;
}

.vehicle-hud__grenade {
  display: block;
  pointer-events: none;
}

.vehicle-hud__fuel-bar,
.vehicle-hud__ammo-bar {
  overflow: hidden;
  pointer-events: none;
}

.vehicle-hud__fuel-fill,
.vehicle-hud__ammo-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #f2d74c;
  box-shadow: inset 0 0 0 1px rgba(96, 72, 8, 0.45);
  transition: width 0.12s ease-out;
}

.vehicle-hud__ammo-fill {
  background: #f0ce43;
}

.player-strip--motor-pool .player-strip__kind {
  opacity: 0.75;
  font-style: italic;
}

.player-strip.player-strip--hotseat-dim {
  opacity: 0.41;
}

.player-strip__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.player-strip__tag {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #9aa3b5;
}

.player-strip__kind {
  text-transform: capitalize;
  font-weight: 600;
  color: #cfd6e6;
}

.player-strip__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-strip__ammo-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 118px;
}

.player-strip__ammo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.player-strip__ammo-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8499;
}

.player-strip__ammo-count {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e8edf9;
  line-height: 1.2;
}

.shell-row {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.shell {
  width: 8px;
  height: 16px;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(90deg, #c9b87a 0%, #e8ddaa 40%, #a89860 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.shell.shell--empty {
  background: #2a2e38;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 0, 0, 0.5);
  opacity: 0.55;
}

.shell-row--mines .shell {
  width: 6px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4a4a52 0%, #6a6a72 45%, #3a3a44 100%);
}

.player-strip__gauges {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gauge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gauge__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a8499;
}

.gauge__track {
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.gauge__track--fuel .gauge__fill {
  height: 100%;
  border-radius: 3px;
  width: 100%;
  background: linear-gradient(90deg, #6a4a12, #e8a82e, #ffd56a);
  transition: width 0.12s ease-out;
}

.gauge__track--hp .gauge__fill {
  height: 100%;
  border-radius: 3px;
  width: 100%;
  background: linear-gradient(90deg, #6b1212, #c43c3c, #5ecf7a);
  background-size: 200% 100%;
  background-position: left;
  transition: width 0.12s ease-out;
}

.minimap-wrap {
  flex-shrink: 0;
}

.minimap-canvas {
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Full-screen victory FMV + winning-team banner after flag capture */
.game-end {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  background: #050608;
  border: none;
  user-select: none;
}

.game-end--hidden {
  display: none !important;
}

.game-end__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #050608;
}

.game-end__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.35) 0%, transparent 38%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.2) 42%, transparent 72%);
}

.game-end__banner {
  position: relative;
  z-index: 2;
  display: block;
  width: 50%;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.game-end__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-end__prompt {
  position: relative;
  z-index: 3;
  margin: 0 0 clamp(20px, 4vh, 40px);
  padding: 0 1rem;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.game-end--awaiting-dismiss:focus {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.death-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: stretch;
  justify-content: center;
  user-select: none;
  visibility: visible;
  pointer-events: auto;
}

.death-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.death-overlay:not(.death-overlay--hidden)::before {
  opacity: 1;
}

.death-overlay--hidden {
  visibility: hidden;
  pointer-events: none;
}

.death-overlay--hidden::before {
  opacity: 0;
  transition-duration: 0.12s;
  transition-timing-function: ease-in;
}

.death-overlay__inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
}

.death-overlay__panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background-color: #030302;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes death-overlay-panel-enter {
    from {
      background-color: rgba(3, 3, 2, 0);
    }

    to {
      background-color: #030302;
    }
  }

  @keyframes death-overlay-content-enter {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .death-overlay__panel.death-overlay__panel--entering {
    animation: death-overlay-panel-enter 0.55s ease-out both;
  }

  .death-overlay__panel.death-overlay__panel--entering .death-overlay__skull,
  .death-overlay__panel.death-overlay__panel--entering .death-overlay__lives {
    animation: death-overlay-content-enter 0.45s ease-out 0.1s both;
  }
}

.death-overlay__skull {
  display: flex;
  align-items: center;
  justify-content: center;
}

.death-overlay__skull-frame {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}

.death-overlay__lives {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.death-overlay__life {
  position: relative;
  width: 24px;
  height: 24px;
}

.death-overlay__life-icon,
.death-overlay__life-lost {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  pointer-events: none;
}

.death-overlay__life-lost {
  z-index: 1;
}

.death-overlay__panel--hidden {
  display: none !important;
}

/* Hotseat: each player’s death UI stays on their half; the other side stays playable. */
.death-overlay--split {
  pointer-events: none;
}

.death-overlay--split .death-overlay__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.death-overlay--split .death-overlay__panel--p0 {
  grid-column: 1;
  border-right: 2px solid rgba(120, 180, 200, 0.35);
}

.death-overlay--split .death-overlay__panel--p1 {
  grid-column: 2;
}

.death-overlay--split .death-overlay__panel:not(.death-overlay__panel--hidden) {
  pointer-events: auto;
}

.death-overlay--split .death-overlay__panel--hidden {
  display: flex !important;
  visibility: hidden;
  background-color: transparent;
  border-color: transparent;
  pointer-events: none;
}

/* —— Start: splash + main menu —— */
body.start-screen-active #game-shell,
body.start-screen-active #hud,
body.start-screen-active #motor-pool-root,
body.start-screen-active #bottom-hud,
body.start-screen-active .hotseat-playfield,
body.start-screen-active #game-end-overlay,
body.start-screen-active #death-overlay {
  visibility: hidden;
  /* pointer-events: none; */
}

body.start-screen-active .start-screen {
  z-index: 8;
}

.start-screen {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #008080;
  padding: clamp(12px, 3vw, 28px);
  background-color: #05070e;
  background-image: url('/ui/start-splash.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  image-rendering: pixelated;
}

.start-screen__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: min(720px, 100%);
  text-align: center;
}

.start-screen__panel--hidden {
  display: none !important;
}

.start-screen__panel--desktop {
  position: relative;
  z-index: 5;
  width: 100%;
}

.start-screen__panel--desktop[hidden],
.start-screen__panel--desktop.start-screen__panel--hidden {
  z-index: auto;
}

/* Options → Sound: checkmark when sound is enabled. */
ul.menu > li[data-menu-action='options-sound-toggle'] {
  position: relative;
}

ul.menu > li[data-menu-action='options-sound-toggle']::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 12px;
  text-align: center;
  pointer-events: none;
}

ul.menu > li[data-menu-action='options-sound-toggle'].menu-item-checked::before {
  content: '✓';
}

.start-screen__window {
  position: relative;
  z-index: 1;
  width: min(22rem, calc(100% - 2rem));
  margin: clamp(12px, 3vw, 28px) auto 0;
}

dialog.keyboard-bindings {
  border: none;
  padding: 0;
  margin: auto;
  inset: 0;
  width: min(52rem, calc(100% - 1.5rem));
  height: fit-content;
  max-height: calc(100% - 1.5rem);
  overflow: visible;
  background: transparent;
  color: inherit;
  text-align: left;
}

dialog.keyboard-bindings::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.keyboard-bindings__window {
  width: 100%;
}

.keyboard-bindings__body {
  max-height: min(32rem, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Only the tab panel scrolls — avoid focusing OK scrolling the tab row off-screen. */
  overflow: hidden;
}

.keyboard-bindings__intro {
  margin: 0 0 0.75rem;
  flex-shrink: 0;
}

.keyboard-bindings__tabs {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Some UAs hide <menu> by default; 98.css expects it visible for tabs. */
dialog.keyboard-bindings menu[role='tablist'] {
  display: flex !important;
  flex-shrink: 0;
}

.keyboard-bindings__tabs > .window[role='tabpanel'] {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.keyboard-bindings__tab-body {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem;
}

.keyboard-bindings__panel--hidden {
  display: none !important;
}

.keyboard-bindings__table-panel {
  overflow: auto;
}

.keyboard-bindings__key {
  display: inline-block;
  padding: 0 0.25rem;
  border: 1px solid #808080;
  border-radius: 2px;
  background: #fff;
}

.keyboard-bindings__note {
  display: block;
  margin-top: 0.1rem;
  color: #404040;
}

.keyboard-bindings__actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 0.75rem;
}

dialog.high-scores {
  border: none;
  padding: 0;
  margin: auto;
  inset: 0;
  width: min(36rem, calc(100% - 1.5rem));
  height: fit-content;
  max-height: calc(100% - 1.5rem);
  overflow: visible;
  background: transparent;
  color: inherit;
  text-align: left;
}

dialog.high-scores::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.high-scores__window {
  width: 100%;
}

.high-scores__body {
  max-height: min(28rem, calc(100vh - 8rem));
  overflow: auto;
}

.high-scores__tab-body {
  padding: 0.5rem;
  max-height: min(22rem, calc(100vh - 12rem));
  overflow: auto;
}

.high-scores__panel--hidden {
  display: none !important;
}

.high-scores__level {
  margin-bottom: 0.5rem;
}


.high-scores__map {
  width: 100%;
}

.high-scores__time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.high-scores__complete {
  display: inline-block;
  width: 1em;
  margin-right: 0.15rem;
  color: #006400;
}

.high-scores__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.start-screen__window--wide {
  width: min(26rem, calc(100% - 2rem));
}

.start-screen__window--level-select {
  width: min(33rem, calc(100% - 2rem));
}

.start-screen__player-fieldset {
  margin: 0 0 0.5rem;
  border: none;
  padding: 0;
}

.start-screen__player-fieldset legend {
  margin-bottom: 0.35rem;
}

.level-selector__layout {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.level-selector__maps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.level-selector__preview {
  display: block;
  width: 100%;
  max-width: 192px;
  height: auto;
  aspect-ratio: 1;
  border: 2px inset #c0c0c0;
  background: #03619a;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.level-selector__list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 10rem;
  overflow-y: auto;
  border: 2px inset #c0c0c0;
  background: #fff;
}

.level-selector__map-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  text-align: left;
}

.level-selector__map-item--selected {
  background: #000080;
  color: #fff;
}

.level-selector__map-item--completed .level-selector__map-complete {
  color: #9fd89f;
}

.level-selector__map-complete {
  flex: 0 0 auto;
  font-weight: bold;
  line-height: 1;
}

.level-selector__map-name {
  flex: 1 1 auto;
  min-width: 0;
}

.level-selector__map-time {
  flex: 0 0 auto;
  font-size: 0.85em;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.level-selector__level--locked {
  opacity: 0.45;
}

.start-screen__names {
  margin: 0.5rem 0 0.25rem;
}

.start-screen__names .field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.start-screen__name-input {
  flex: 1 1 auto;
  min-width: 8rem;
  max-width: 14rem;
}

.level-selector__map-icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8fd4ff, #03619a 55%, #024a75);
  border: 1px solid #024a75;
}

.level-selector__actions {
  justify-content: center;
}

.start-screen__hero {
  max-width: min(640px, 100%);
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.start-screen__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

/* Match 98.css `button` so menu links align with adjacent controls */
.start-screen__nav-as-button {
  display: block;
  width: 100%;
  min-height: 23px;
  min-width: 75px;
  padding: 0 12px;
  border: none;
  border-radius: 0;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  color: transparent;
  font: inherit;
  line-height: 23px;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 0 #222;
}

.start-screen__nav-as-button:active {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey;
  text-shadow: 1px 1px #222;
}

.start-screen__nav-as-button:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.map-editor-page {
  margin: 0;
  min-height: 100vh;
  width: 100%;
}

.map-editor-page__body > .rfm-map-editor-window {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  margin: 0;
}

.start-screen__map-field {
  width: 100%;
  margin-bottom: 0.5rem;
}

.start-screen__map-mode {
  margin: 0 0 0.5rem;
}

.start-screen__map-support {
  margin: 0.35rem 0 0;
}

.start-screen__map-warning {
  margin: 0.35rem 0 0;
}

.start-screen__map-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.start-screen__settings-note {
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

/* Standalone map editor (map-editor.html) — layout inspired by jondegn.github.io/return-fire-map-editor/ */

.rfm-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.35);
}

.rfm-modal-bg[hidden] {
  display: none;
}

.rfm-modal-window {
  position: fixed;
  z-index: 210;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(300px, calc(100vw - 32px));
}

.rfm-modal-window[hidden] {
  display: none;
}

.rfm-modal-window__actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.rfm-map-editor-window {
  display: flex;
  flex-direction: column;
}

.rfm-map-editor-window__title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rfm-map-editor-window__favicon {
  flex-shrink: 0;
  display: block;
}

.rfm-map-editor-window-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfm-map-editor__stage {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  height: calc(100vh - 300px);
  padding: 4px;
  background-color: silver;
  overflow: hidden;
}

.rfm-map-editor__bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
}

.rfm-map-editor__upload-row {
  margin-top: 4px;
}

.rfm-map-editor__upload-row > * + * {
  margin-top: 8px;
}

.rfm-map-editor__upload-as-button {
  display: inline-block;
  min-height: 23px;
  min-width: 75px;
  padding: 0 12px;
  border: none;
  border-radius: 0;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  color: transparent;
  font: inherit;
  line-height: 23px;
  text-align: center;
  text-shadow: 0 0 #222;
  cursor: pointer;
}

.rfm-map-editor__upload-as-button:active {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey;
  text-shadow: 1px 1px #222;
}

.rfm-map-editor__map-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 0 4px;
  flex: 1 1 280px;
}

.rfm-map-settings__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rfm-map-editor__canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(90, 130, 150, 0.35);
  background: black;
  touch-action: none;
  overflow: hidden;
}

.rfm-map-editor__hint {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(34, 34, 34, 0.88);
}

.rfm-map-editor__palette-mount {
  width: 368px;
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 0;
  min-width: 0;
}

.rfm-map-editor__palette {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}
.rfm-map-editor__palette-panel {
  height: calc(100vh - 330px);
  overflow: auto;
}

.rfm-map-editor__palette-panel--hidden {
  display: none;
}

.rfm-map-editor__palette-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--rfm-palette-cols, 5), max-content);
}

.rfm-map-editor__palette-tile {
  padding: 0;
  background-color: rgba(18, 22, 36, 0.88);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  cursor: pointer;
  min-width: auto;
}

.rfm-map-editor__palette-selection {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid #feeb77;
}

.rfm-map-editor__status--err {
  color: #8b0000;
}

.map-editor__window {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.map-editor__body {
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.map-editor {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.map-editor__hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(200, 210, 225, 0.82);
}

.map-editor__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.map-editor__row--layer {
  justify-content: flex-start;
}

.map-editor__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(140, 200, 190, 0.95);
  min-width: 4.5rem;
}

.map-editor__select {
  flex: 1;
  min-width: 12rem;
  max-width: 24rem;
}

.map-editor__radio {
  font-size: 0.9rem;
  color: rgba(220, 228, 240, 0.92);
  cursor: pointer;
  user-select: none;
}

.map-editor__brushes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem 0.75rem;
}

.map-editor__brush-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.map-editor__brush {
  font: 0.72rem/1.1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  min-width: 1.65rem;
  padding: 0.2rem 0.35rem;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 36, 0.88);
  color: #e8eaf0;
  cursor: pointer;
  box-shadow: none;
}

.map-editor__brush:hover {
  border-color: rgba(120, 180, 220, 0.4);
}

.map-editor__brush--on {
  border-color: rgba(120, 220, 180, 0.65);
  background: rgba(32, 52, 48, 0.95);
  color: #c8ffe8;
}

.map-editor__grid-wrap {
  max-height: min(52vh, 480px);
  overflow: auto;
  border: 1px solid rgba(90, 130, 150, 0.35);
  border-radius: 6px;
  padding: 6px;
  background: rgba(6, 10, 18, 0.65);
}

.map-editor__grid {
  display: grid;
  gap: 1px;
  width: max-content;
  margin: 0 auto;
}

.map-editor__cell {
  font: 0.62rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 1px;
  background: rgba(28, 34, 48, 0.95);
  color: rgba(230, 235, 245, 0.95);
  cursor: crosshair;
}

.map-editor__cell:hover {
  outline: 1px solid rgba(120, 180, 255, 0.45);
  outline-offset: -1px;
}

.map-editor__meta {
  width: 100%;
  font: 0.78rem/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 26, 0.92);
  color: #e0e6f0;
  resize: vertical;
  min-height: 5rem;
}

.map-editor__status {
  margin: 0;
  font-size: 0.82rem;
  min-height: 1.25rem;
  color: rgba(160, 220, 200, 0.95);
}

.map-editor__status--err {
  color: #f0b0b0;
}

.map-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Quit: shown when the player leaves from the menu (HTML + CSS only; JS toggles body class). */
.quit-screen {
  display: none;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2rem;
  background: #c0c0c0;
}

.quit-screen__window {
  width: min(22rem, 100%);
}

body.state-quit .quit-screen {
  display: flex;
}

body.state-quit #start-screen-root,
body.state-quit #game-shell,
body.state-quit #app,
body.state-quit #hud,
body.state-quit #motor-pool-root,
body.state-quit #bottom-hud,
body.state-quit #game-end-overlay,
body.state-quit #death-overlay {
  display: none !important;
  visibility: hidden;
}

.tile-debug-hud {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  display: none;
  max-width: min(28rem, calc(100vw - 1rem));
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #e8f0ff;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
}

.tile-debug-hud--active {
  display: block;
}

.tile-debug-hud__readout {
  white-space: pre-wrap;
}

.tile-debug-hud__hint {
  margin-top: 0.25rem;
  color: rgba(232, 240, 255, 0.72);
  font-size: 11px;
}

/* DEV: in-game debug overlay toggles (not PixiJS DevTools browser extension). */
.dev-debug-panel {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: auto;
}

.dev-debug-panel__toggle {
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(232, 240, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #e8f0ff;
  cursor: pointer;
  font: inherit;
}

.dev-debug-panel__toggle:hover {
  background: rgba(24, 40, 72, 0.92);
}

.dev-debug-panel__body {
  display: none;
  min-width: 14rem;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.45rem 0.55rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.82);
  color: #e8f0ff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.dev-debug-panel--open .dev-debug-panel__body {
  display: block;
}

.dev-debug-panel__title {
  margin: 0 0 0.35rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232, 240, 255, 0.75);
}

.dev-debug-panel__row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.4rem;
  row-gap: 0.1rem;
  align-items: center;
  margin: 0.2rem 0;
  cursor: pointer;
}

.dev-debug-panel__row input {
  grid-row: 1 / span 2;
  margin: 0;
  cursor: pointer;
}

.dev-debug-panel__label {
  font-size: 12px;
}

.dev-debug-panel__hint {
  grid-column: 2;
  font-size: 10px;
  color: rgba(232, 240, 255, 0.62);
}

.dev-debug-panel__foot {
  margin: 0.4rem 0 0;
  font-size: 10px;
  color: rgba(232, 240, 255, 0.5);
  line-height: 1.3;
}
