.action-wheel {
  position: fixed;
  z-index: 40;
  aspect-ratio: 1;
  touch-action: none;
  filter: drop-shadow(0 8px 22px #071d28cc);
}
.action-wheel[hidden], .action-wheel-sheet[hidden] { display: none !important; }
.action-wheel canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.action-wheel-option {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
.action-wheel-hint {
  position: absolute;
  top: 100%;
  left: 0;
  box-sizing: border-box;
  width: 100%;
  margin: 2px 0 0;
  padding: 6px 9px;
  background: #102b34;
  color: #fff4d7;
  border: 1px solid #719e91;
  border-radius: 7px;
  font: 12px/1.3 system-ui;
}
.action-wheel-sheet {
  position: fixed;
  z-index: 41;
  right: 16px;
  bottom: 16px;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  max-height: min(75vh, 680px);
  height: max-content;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  background: #19383f;
  color: #fff4d7;
  border: 1px solid #719e91;
  border-radius: 12px;
  box-shadow: 0 10px 25px #071d28cc;
}
#game .action-wheel-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}
.action-wheel-sheet h2 { align-self: center; margin: 0; font-size: 1.15rem; }
.action-wheel-sheet #actions {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.action-wheel-sheet button, .action-wheel-sheet select { max-width: 100%; }
.action-wheel-sheet > button {
  align-self: start;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
}
.action-wheel-sheet #actions > section[data-site] {
  margin: 0;
}
.action-wheel-sheet #actions button { min-height: 44px; margin: 4px 4px 4px 0; cursor: pointer; }
.action-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -.22em;
  margin-right: .4em;
  color: #f4d899;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.action-card {
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #597d79;
  border-radius: 9px;
  background: #193b40;
}
.action-card > h4 { margin: 0 0 8px; color: #f4d899; }
.action-card p { margin: 6px 0; }
.action-card select { width: 100%; min-height: 44px; }
.action-wheel-sheet button:focus-visible,
.action-wheel-sheet select:focus-visible,
.action-wheel-sheet input:focus-visible,
.house-style-option:focus-within { outline: 3px solid #ffe095; outline-offset: 2px; }
@media (max-width: 600px) {
  .action-wheel-sheet { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 82dvh; }
}
.house-style-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #719e91;
  border-radius: 9px;
  min-inline-size: 0;
}
.house-style-picker legend { font-weight: 600; color: #f4d899; }
.house-style-option {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  padding: 7px;
  margin: 0;
  min-width: 0;
  border: 2px solid #597d79;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}
.house-style-option:has(input:checked) { border-color: #ffe095; background: #295951; }
.house-style-option canvas { width: 100%; max-width: 144px; height: auto; aspect-ratio: 144 / 100; }
.house-style-option input { width: auto; align-self: flex-start; accent-color: #f4d899; }
.house-finish-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #719e91;
  border-radius: 9px;
  min-inline-size: 0;
}
.house-finish-picker legend { font-weight: 600; color: #f4d899; }
.house-finish-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 44px;
  padding: 5px;
  margin: 0;
  border: 2px solid #597d79;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  overflow-wrap: anywhere;
}
.house-finish-option:has(input:checked) { border-color: #ffe095; background: #295951; }
.house-finish-option:focus-within { outline: 3px solid #ffe095; outline-offset: 2px; }
.house-finish-option input { width: auto; accent-color: #f4d899; }
.house-finish-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid #fff4d7;
  border-radius: 50%;
  flex: none;
}
@media (max-width: 420px) {
  .house-style-picker { gap: 4px; padding: 4px; }
  .house-style-option { padding: 5px; font-size: .85rem; overflow-wrap: anywhere; }
  .house-finish-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; }
}
