:root {
  --cream: #e9dfc8;
  --cream-deep: #ddd0b4;
  --ink: #25241f;
  --ink-soft: #555044;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(120% 90% at 50% 18%, #f3ebda 0%, var(--cream) 52%, var(--cream-deep) 100%);
  color: var(--ink);
  font-family: "Archivo", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px 4px;
}

#stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage canvas {
  display: block;
  box-shadow:
    0 0 0 2px #2b2a25,
    0 0 0 4px var(--cream),
    0 0 0 6px #736b5a,
    0 10px 28px rgba(42, 36, 22, 0.35);
}

#legend {
  flex: 0 0 auto;
  padding: 5px 12px 7px;
  border-top: 1px solid rgba(70, 62, 45, 0.35);
  background: rgba(243, 235, 218, 0.6);
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 1.35vw, 13px);
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.45;
  white-space: normal;
}

#coarse, #rotate { display: none; }

#rotate { color: #7b3a2a; }

@media (pointer: coarse) {
  #legend { font-size: clamp(10px, 2.7vw, 13px); }
  .wide { display: none; }
  #coarse { display: inline; }
}

@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: inline; }
}
