.bober-app {
  width: min(92vw, 40rem);
  margin: 0 auto;
}

.bober-top {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0 10px;
  background: #ffffff;
  color: #111111;
  border: 3px solid #dc143c;
}

.bober-brand {
  margin: 0;
  padding: 8px 10px 6px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dc143c;
  background: #ffffff;
}

.bober-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #dc143c;
  color: #ffffff;
}

.bober-hud {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
}

.bober-hud span {
  white-space: nowrap;
}

.bober-langs {
  display: flex;
  gap: 6px;
}

.bober-langs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 6px 4px;
  min-width: 32px;
  min-height: 32px;
  opacity: 0.45;
}

.bober-langs button[aria-pressed="true"] {
  opacity: 1;
  font-weight: 700;
}

.bober-stage {
  position: relative;
  background: #ffffff;
  border: 3px solid #dc143c;
}

.bober-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  touch-action: none;
  outline: none;
}

.bober-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 16px;
  text-align: center;
  background: rgba(255, 248, 232, 0.94);
  color: #1a1a1a;
}

.bober-overlay[hidden] {
  display: none;
}

.bober-overlay h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c23b22;
}

.bober-overlay p {
  margin: 0;
  max-width: 22rem;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  color: #1a1a1a;
}

.bober-overlay button {
  appearance: none;
  border: 0;
  background: #c23b22;
  color: #ffffff;
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  min-width: 44px;
  min-height: 44px;
}

.bober-status {
  margin: 10px 0 0;
  min-height: 1.2em;
  text-align: center;
  font-weight: 700;
  color: #dc143c;
}

.bober-status[hidden] {
  display: none;
}

.bober-keys {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
}

.bober-pad {
  display: grid;
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 56px 56px;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.bober-pad button {
  appearance: none;
  border: 2px solid #1f4e34;
  background: #f4c430;
  color: #1a1a1a;
  font: inherit;
  font-size: 1.35rem;
  padding: 0;
  min-width: 56px;
  min-height: 48px;
  touch-action: none;
}

.bober-pad [data-dir="up"] {
  grid-column: 2;
  grid-row: 1;
  background: #2f9e4f;
  color: #ffffff;
}

.bober-pad [data-dir="left"] {
  grid-column: 1;
  grid-row: 2;
  background: #2b6cb0;
  color: #ffffff;
}

.bober-pad [data-dir="down"] {
  grid-column: 2;
  grid-row: 2;
  background: #c23b22;
  color: #ffffff;
}

.bober-pad [data-dir="right"] {
  grid-column: 3;
  grid-row: 2;
  background: #d97706;
  color: #ffffff;
}
