:root {
  --desktop-green: #0a7f73;
  --desktop-green-dark: #04584f;
  --desktop-overlay: rgba(6, 52, 47, 0.12);
  --win-bg: #c0c0c0;
  --win-panel: #c0c0c0;
  --win-shadow: #808080;
  --win-dark: #404040;
  --win-light: #ffffff;
  --title-blue: #000080;
  --title-blue-light: #0a45b7;
  --text: #111111;
  --counter-bg: #120000;
  --counter-red: #ff2b2b;
  --desktop-text: #ffffff;
  --cell-bg: #bdbdbd;
  --cell-revealed: #adadad;
  --cell-border-light: #ffffff;
  --cell-border-dark: #808080;
  --hint-one: #0000ff;
  --hint-two: #008000;
  --hint-three: #ff0000;
  --hint-four: #000080;
  --mine-red: #d10000;
  --question-text: #002e8a;
  font-family: Tahoma, "MS Sans Serif", Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

body {
  position: fixed;
  inset: 0;
  color: #111111;
  background: #000;
  touch-action: manipulation;
}

button,
select,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.desktop-app {
  height: 100%;
  overflow: hidden;
}

.desktop-scene {
  height: 100%;
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-gap: 24px;
  gap: 24px;
  align-items: stretch;
  padding: 18px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 62%, rgba(255, 255, 255, 0.12) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 12%, transparent 12% 100%),
    linear-gradient(180deg, rgba(6, 52, 47, 0.12), transparent 28%),
    linear-gradient(180deg, #0a7f73 0%, #04584f 100%);
  background-size: 120px 120px, 86px 86px, 100% 100%, 100% 100%, 100% 100%;
}

.desktop-scene * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.desktop-shortcuts {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  padding-top: 10px;
}

.desktop-help-shortcut {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 92px;
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  justify-items: center;
  border: 0;
  padding: 4px;
  background: transparent;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
}

.desktop-help-shortcut:focus-visible,
.desktop-help-shortcut.is-active {
  outline: 1px dotted #fff;
  outline-offset: 2px;
  background: rgba(0, 0, 128, 0.32);
}

.desktop-help-icon {
  width: 42px;
  height: 42px;
  position: relative;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.desktop-help-icon::before {
  content: "?";
  position: absolute;
  inset: 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #000080;
  border-radius: 50%;
  font: 700 25px/1 Tahoma, "MS Sans Serif", Verdana, sans-serif;
}

.desktop-shortcut {
  width: 92px;
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  justify-items: center;
  border: 0;
  padding: 4px;
  background: transparent;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
}

.desktop-shortcut:focus-visible,
.desktop-shortcut.is-active {
  outline: 1px dotted #fff;
  outline-offset: 2px;
  background: rgba(0, 0, 128, 0.32);
}

.desktop-shortcut-icon {
  width: 42px;
  height: 42px;
  position: relative;
  background:
    linear-gradient(90deg, transparent 0 2px, #111 2px 40px, transparent 40px 42px) center/42px 5px no-repeat,
    linear-gradient(180deg, transparent 0 2px, #111 2px 40px, transparent 40px 42px) center/5px 42px no-repeat,
    linear-gradient(45deg, transparent 0 16px, #111 16px 21px, transparent 21px 100%) center/36px 36px no-repeat,
    linear-gradient(-45deg, transparent 0 16px, #111 16px 21px, transparent 21px 100%) center/36px 36px no-repeat;
}

.desktop-shortcut-icon::before,
.desktop-shortcut-icon::after {
  content: "";
  position: absolute;
}

.desktop-shortcut-icon::before {
  width: 28px;
  height: 28px;
  left: 7px;
  top: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #777 0 3px, #2a2a2a 4px 10px, #050505 11px 100%);
  border: 1px solid #000;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.45), inset 2px 2px 0 rgba(255, 255, 255, 0.18);
}

.desktop-shortcut-icon::after {
  width: 7px;
  height: 7px;
  left: 13px;
  top: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.desktop-shortcut-label {
  font-size: 12px;
  line-height: 1.15;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.onboarding-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.28);
}

.onboarding-window {
  width: min(520px, calc(100vw - 36px));
}

.onboarding-content {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.35;
}

.onboarding-content p {
  margin: 0;
}

.onboarding-examples {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.4fr);
  grid-gap: 8px;
  gap: 8px;
}

.onboarding-example-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-gap: 9px;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  background: rgba(255, 255, 255, 0.42);
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

.onboarding-example-caption,
.onboarding-special-title {
  font-weight: 700;
}

.onboarding-special-title {
  color: #000080;
}

.onboarding-special-outcomes {
  display: grid;
  grid-gap: 1px;
  gap: 1px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
}

.onboarding-special-outcomes > span:not(.onboarding-special-or)::before {
  content: "• ";
}

.onboarding-special-or {
  padding-left: 10px;
  color: #555;
  font-style: italic;
}

.onboarding-example-cell {
  position: relative;
  width: 46px;
  height: 46px;
  background: #adadad;
  border: 1px solid #808080;
}

.onboarding-arrow {
  transform: scale(0.72);
  transform-origin: center;
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-example-cell span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #0000ff;
  font: 900 20px/1 Arial, Tahoma, "MS Sans Serif", Verdana, sans-serif;
  -webkit-text-stroke: 0.75px currentColor;
  text-shadow: 0.75px 0 currentColor, -0.75px 0 currentColor, 0 0.75px currentColor, 0 -0.75px currentColor;
}

.onboarding-example-one span {
  color: #0000ff;
}

.onboarding-example-two span {
  color: #008000;
}

.onboarding-example-three span {
  color: #ff0000;
}

.onboarding-example-four span {
  color: #000080;
}

.onboarding-example-one span {
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
}

.onboarding-example-two span:first-child {
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-example-two span:last-child {
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
}

.onboarding-example-three span:nth-child(1) {
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-example-three span:nth-child(2) {
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
}

.onboarding-example-three span:nth-child(3) {
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-example-four span:nth-child(1) {
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-example-four span:nth-child(2) {
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
}

.onboarding-example-four span:nth-child(3) {
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-example-four span:nth-child(4) {
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
}

.onboarding-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.onboarding-close-button {
  justify-self: end;
  min-width: 72px;
  min-height: 28px;
  padding: 2px 16px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.onboarding-close-button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -5px;
}

.window-stack {
  position: relative;
  z-index: 10;
  pointer-events: none;
  display: grid;
  place-items: center;
  min-width: 0;
}

.window-frame {
  width: -webkit-fit-content;
  width: fit-content;
  max-width: calc(100vw - 36px);
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
.minesweeper-window {
  pointer-events: auto;
}

.window-titlebar {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding: 3px 4px 3px 6px;
  color: #fff;
  background: linear-gradient(90deg, #000080 0%, #0a45b7 100%);
}

.window-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.window-app-icon {
  width: 16px;
  height: 16px;
  position: relative;
  flex: 0 0 auto;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
}

.window-app-icon::before,
.window-app-icon::after {
  content: "";
  position: absolute;
}

.window-app-icon::before {
  width: 7px;
  height: 7px;
  left: 1px;
  top: 1px;
  background: #d10000;
}

.window-app-icon::after {
  width: 7px;
  height: 7px;
  right: 1px;
  bottom: 1px;
  background: #000;
}

.window-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.window-system-buttons {
  display: flex;
  gap: 2px;
}

.window-system-button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #111;
  background: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  font-size: 11px;
  line-height: 1;
}

.window-menubar {
  display: flex;
  gap: 2px;
  align-items: flex-start;
  padding: 4px 6px 2px;
}

.menu-wrapper {
  position: relative;
}

.menu-button {
  min-height: 22px;
  border: 0;
  background: transparent;
  padding: 1px 8px;
  font-size: 13px;
}

.menu-button:hover,
.menu-button:focus-visible,
.menu-button.is-open {
  outline: 1px dotted #000;
  background: rgba(0, 0, 128, 0.12);
}

.game-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 20;
  min-width: 180px;
  padding: 2px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.22);
}

.game-menu-item {
  width: 100%;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  padding: 4px 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.game-menu-item::after {
  content: "";
  width: 12px;
  flex: 0 0 12px;
  text-align: center;
}

.game-menu-item.is-active::after {
  content: "•";
}

.game-menu-item:hover,
.game-menu-item:focus-visible {
  background: #000080;
  color: #fff;
  outline: none;
}

.game-menu-separator {
  height: 2px;
  margin: 2px 1px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #ffffff;
}

.help-menu {
  width: min(360px, calc(100vw - 24px));
  padding: 10px 12px 8px;
  cursor: default;
}

.help-title {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.2;
}

.help-section {
  margin: 0 0 8px;
}

.help-section h3 {
  margin: 0 0 2px;
  font-size: 13px;
  line-height: 1.2;
}

.help-section p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.help-close-button {
  justify-content: center;
  min-height: 24px;
  margin-top: 8px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.help-close-button::after {
  display: none;
}

.window-content {
  padding: 4px 8px 8px;
}

.game-shell {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.window-inset {
  background: #c0c0c0;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.window-panel {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.scorebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
}

.digital-counter {
  min-width: 68px;
  padding: 4px 6px 2px;
  background: #120000;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  color: #ff2b2b;
  font-family: "Courier New", monospace;
  font-size: 34px;
  line-height: 1;
  text-align: right;
  letter-spacing: 1px;
}

.face-button {
  border: 0;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
}

.face-button:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.face-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 24px;
  cursor: pointer;
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 13px;
}

.status-caption {
  color: #333;
}

.board-shell {
  padding: 10px;
  max-width: calc(100vw - 76px);
  max-height: calc(100dvh - 150px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.board-wrap {
  width: -webkit-fit-content;
  width: fit-content;
  min-width: 100%;
}

.board {
  display: grid;
  grid-gap: 0;
  gap: 0;
  width: -webkit-fit-content;
  width: fit-content;
  background: #bdbdbd;
  border-top: 3px solid #808080;
  border-left: 3px solid #808080;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.cell {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #bdbdbd;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  color: #111;
  font: 700 32px/1 Tahoma, "MS Sans Serif", Verdana, sans-serif;
  cursor: pointer;
}

.cell:focus-visible,
.face-button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.cell.is-revealed {
  background: #adadad;
  border: 1px solid #808080;
  cursor: default;
}

.cell.is-mine {
  color: #000;
  background: #f2b2b2;
}

.cell.is-flagged {
  color: #d10000;
}

.cell.is-questioned {
  color: #002e8a;
  font-weight: 700;
}

.cell.has-hints {
  position: relative;
  display: block;
  padding: 0;
}

.cell-arrow {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 26px;
  height: 26px;
  font-family: Arial, Tahoma, "MS Sans Serif", Verdana, sans-serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: #0000ff;
  -webkit-text-stroke: 0.9px currentColor;
  text-shadow: 0.9px 0 currentColor, -0.9px 0 currentColor, 0 0.9px currentColor, 0 -0.9px currentColor;
}

.cell.has-hint-count-1 .cell-arrow {
  color: #0000ff;
}

.cell.has-hint-count-2 .cell-arrow {
  color: #008000;
}

.cell.has-hint-count-3 .cell-arrow {
  color: #ff0000;
}

.cell.has-hint-count-4 .cell-arrow {
  color: #000080;
}

.cell-arrow[data-direction="up"] {
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
}

.cell-arrow[data-direction="right"] {
  top: calc(50% - 2px);
  right: 1px;
  transform: translateY(-50%);
}

.cell-arrow[data-direction="down"] {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.cell-arrow[data-direction="left"] {
  top: calc(50% - 2px);
  left: 2px;
  transform: translateY(-50%);
}


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

@media (max-width: 980px) {
  .desktop-scene {
    gap: 14px;
    padding: 12px;
  }

  .desktop-shortcuts {
    top: 12px;
    left: 12px;
  }

  .desktop-help-shortcut {
    top: 12px;
    right: 12px;
  }

  .window-frame {
    max-width: 100%;
  }

  .cell {
    width: 49px;
    height: 49px;
    font-size: 29px;
  }
}

@media (max-width: 720px) {
  .desktop-scene {
    display: block;
    padding: 0;
    background: #c0c0c0;
  }

  .desktop-shortcuts {
    display: none;
  }

  .desktop-help-shortcut {
    display: none;
  }

  .onboarding-overlay {
    padding: 10px;
  }

  .onboarding-window {
    width: min(100%, 440px);
  }

  .onboarding-examples {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .onboarding-example-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
  }

  .onboarding-example-cell {
    width: 40px;
    height: 40px;
  }

  .onboarding-content {
    gap: 8px;
    padding: 10px;
    font-size: 12px;
  }

  .onboarding-list {
    gap: 6px;
  }

  .window-stack {
    display: block;
  }

  .window-frame {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .onboarding-window {
    width: min(100%, 440px);
    min-height: 0;
    max-height: calc(100dvh - 20px);
    overflow: auto;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  }

  .window-content {
    padding: 4px 6px 8px;
  }

  .game-menu {
    min-width: 170px;
  }

  .help-menu {
    position: fixed;
    top: 58px;
    left: 6px;
    right: 6px;
    width: auto;
    max-height: calc(100dvh - 70px);
    overflow: auto;
  }

  .scorebar {
    gap: 10px;
    padding: 6px;
  }

  .digital-counter {
    min-width: 56px;
    font-size: 28px;
  }

  .face-button {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .board-shell {
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 150px);
    padding: 6px;
  }

  .board-wrap {
    min-width: 0;
  }

  .cell {
    --mobile-cell-size: 48px;
    width: var(--mobile-cell-size);
    height: var(--mobile-cell-size);
    font-size: 28px;
  }

  .desktop-scene[data-difficulty="novice"] .cell {
    --mobile-cell-size: min(48px, calc(10vw - 3.4px));
    font-size: clamp(18px, calc(5.8vw - 2px), 28px);
  }

  .cell-arrow {
    --mobile-arrow-size: clamp(17px, calc(var(--mobile-cell-size) * 0.58), 27px);
    width: var(--mobile-arrow-size);
    height: var(--mobile-arrow-size);
    font-size: var(--mobile-arrow-size);
  }

  .cell-arrow[data-direction="up"] {
    top: calc(var(--mobile-cell-size) * 0.04);
    left: 50%;
    transform: translateX(-50%);
  }

  .cell-arrow[data-direction="right"] {
    top: 50%;
    right: calc(var(--mobile-cell-size) * 0.04);
    transform: translateY(-50%);
  }

  .cell-arrow[data-direction="down"] {
    bottom: calc(var(--mobile-cell-size) * 0.04);
    left: 50%;
    transform: translateX(-50%);
  }

  .cell-arrow[data-direction="left"] {
    top: 50%;
    left: calc(var(--mobile-cell-size) * -0.06);
    transform: translateY(-50%);
  }
}

/* SVG compass arrows have one precise origin across iOS, Android, and desktop. */
.cell-arrow {
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cell-arrow[data-direction="up"] {
  top: calc(50% + 1px);
  left: 50%;
  transform: translate(-50%, -100%);
}

.cell-arrow[data-direction="right"] {
  top: calc(50% - 1px);
  right: auto;
  left: calc(50% - 1px);
  transform: translate(0, -50%);
}

.cell-arrow[data-direction="down"] {
  top: calc(50% - 1px);
  bottom: auto;
  left: 50%;
  transform: translate(-50%, 0);
}

.cell-arrow[data-direction="left"] {
  top: calc(50% - 1px);
  right: auto;
  left: calc(50% + 1px);
  transform: translate(-100%, -50%);
}

@media (max-width: 720px) {
  .cell-arrow[data-direction="up"],
  .cell-arrow[data-direction="right"],
  .cell-arrow[data-direction="down"],
  .cell-arrow[data-direction="left"] {
    top: calc(50% - 2px);
  }
}

@media (min-width: 721px) {
  .cell-arrow[data-direction="up"],
  .cell-arrow[data-direction="right"],
  .cell-arrow[data-direction="down"],
  .cell-arrow[data-direction="left"] {
    top: calc(50% - 2px);
  }
}

@media (max-width: 720px) {
  .cell-arrow[data-direction="up"] {
    transform: translate(-50%, -100%) scaleY(0.9);
    transform-origin: 50% 100%;
  }

  .cell-arrow[data-direction="right"] {
    transform: translate(0, -50%) scaleX(0.9);
    transform-origin: 0 50%;
  }

  .cell-arrow[data-direction="down"] {
    transform: translate(-50%, 0) scaleY(0.9);
    transform-origin: 50% 0;
  }

  .cell-arrow[data-direction="left"] {
    transform: translate(-100%, -50%) scaleX(0.9);
    transform-origin: 100% 50%;
  }
}

.board.board--legacy-grid {
  display: flex;
  flex-wrap: wrap;
}

.board.board--legacy-grid .cell {
  flex: 0 0 auto;
}

@supports not (display: grid) {
  .desktop-app,
  .desktop-scene {
    min-height: 100vh;
  }

  .desktop-scene {
    display: block;
  }

  .desktop-help-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .onboarding-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .onboarding-content {
    display: block;
  }

  .onboarding-content > * + * {
    margin-top: 12px;
  }

  .onboarding-examples {
    display: flex;
    flex-wrap: wrap;
  }

  .onboarding-example-card {
    flex: 1 1 190px;
  }

  .window-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }

  .window-system-button,
  .face-button {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-shell {
    display: block;
  }

  .game-shell > * + * {
    margin-top: 8px;
  }

  .onboarding-window {
    width: calc(100vw - 36px);
    max-width: 520px;
  }

  .help-menu {
    width: calc(100vw - 24px);
    max-width: 360px;
  }

  @media (max-width: 720px) {
    .window-frame {
      min-height: 100vh;
    }

    .onboarding-window {
      max-height: calc(100vh - 20px);
    }

    .help-menu {
      max-height: calc(100vh - 70px);
    }

    .board-shell {
      max-height: calc(100vh - 150px);
    }
  }
}
