:root {
  --bg: #171324;
  --cream: #f6e7c8;
  --amber: #f5b85a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--cream);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

#root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#stage {
  visibility: hidden;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background: #2b233b;
  touch-action: none;
}

#pulse {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  display: none;
  touch-action: none;
}

body.ready #stage {
  visibility: visible;
}

body.wide #pulse {
  display: block;
}

#strip {
  display: none;
  flex: 0 0 64px;
  height: 64px;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px 12px;
  background: var(--bg);
  touch-action: none;
}

body.compact #strip {
  display: flex;
}

#pulse-strip {
  width: 96px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: none;
}

#pulse-cv {
  width: 96px;
  height: 44px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.back {
  position: relative;
  z-index: 5;
  flex: none;
  align-self: flex-start;
  margin: calc(8px + env(safe-area-inset-top)) 0 6px calc(8px + env(safe-area-inset-left));
  padding: 6px 8px;
  border: 2px solid #63516a;
  background: #2b233b;
  color: var(--cream);
  font: 700 12px/1 "Courier New", ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  touch-action: manipulation;
}

.back:hover,
.back:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
  outline: none;
}
