.theme-html5-game {
  box-sizing: border-box;
  width: min(640px, 96vw);
  margin: 0 auto 18px;
  border: 1px solid #9fc3a0;
  background: #f7fbf5;
  color: #203622;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

.theme-html5-game * {
  box-sizing: border-box;
}

.theme-game-shell {
  min-height: 480px;
  padding: 12px;
  background: linear-gradient(#ffffff, #f2fbf1);
}

.theme-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #c6dec6;
  padding-bottom: 8px;
}

.theme-game-title {
  margin: 0;
  color: #2c7d31;
  font-size: 22px;
  line-height: 1.2;
}

.theme-stats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: bold;
}

.theme-pill {
  border: 1px solid #bfd6bf;
  border-radius: 4px;
  background: #ffffff;
  padding: 5px 8px;
}

.theme-stage {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  align-items: stretch;
}

.theme-art-panel,
.theme-controls {
  border: 1px solid #c6dec6;
  border-radius: 4px;
  background: #ffffff;
}

.theme-art-panel {
  min-height: 382px;
  padding: 6px;
}

.theme-art-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.theme-region {
  cursor: pointer;
  transition: filter 120ms ease, stroke-width 120ms ease;
}

.theme-region:hover,
.theme-region:focus {
  filter: brightness(1.06);
  stroke-width: 3;
}

.theme-region.is-done {
  cursor: default;
}

.theme-label {
  fill: #263826;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
  text-anchor: middle;
}

.theme-controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
}

.theme-problem {
  border: 1px solid #d7e8d7;
  border-radius: 4px;
  background: #f9fff8;
  padding: 8px;
}

.theme-problem-title {
  margin: 0 0 7px;
  color: #365638;
  font-weight: bold;
}

.theme-answer-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 6px;
}

.theme-answer-row input {
  width: 100%;
  border: 1px solid #adc9ad;
  border-radius: 4px;
  font-size: 18px;
  padding: 5px 6px;
}

.theme-button {
  border: 1px solid #247a2a;
  border-radius: 4px;
  background: #2f8f36;
  color: #ffffff;
  cursor: pointer;
  font-weight: bold;
  padding: 7px 10px;
}

.theme-button:hover,
.theme-button:focus {
  background: #236f29;
}

.theme-palette {
  display: grid;
  gap: 6px;
}

.theme-swatch {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid #c9d8c9;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  padding: 5px;
  text-align: left;
}

.theme-swatch.is-active {
  border-color: #1a6fb0;
  box-shadow: 0 0 0 2px #bfe3ff;
}

.theme-swatch.is-locked {
  color: #7c8b7c;
  cursor: not-allowed;
  opacity: 0.72;
}

.theme-color-dot {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.theme-status {
  min-height: 34px;
  color: #344d34;
  font-weight: bold;
  line-height: 1.35;
}

.theme-canvas-panel {
  position: relative;
  min-height: 382px;
  overflow: hidden;
}

.theme-game-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: #e8f6ff;
  cursor: none;
}

.theme-help {
  margin: 0;
  color: #435b43;
  font-size: 13px;
  line-height: 1.35;
}

.theme-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid #adc9ad;
  border-radius: 3px;
  background: #ffffff;
}

.theme-progress-bar {
  height: 100%;
  width: 0%;
  background: #44a24d;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.theme-choice-grid .theme-button {
  min-height: 38px;
  text-align: left;
}

.theme-tool-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.theme-tool-row .theme-button.is-active {
  background: #704099;
  border-color: #4f2773;
}

@media (max-width: 700px) {
  .theme-game-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .theme-stats {
    justify-content: flex-start;
  }

  .theme-stage {
    grid-template-columns: 1fr;
  }
}
