:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #e9e6dc;
  color: #161713;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #e9e6dc;
}

button {
  font: inherit;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 32rem;
  isolation: isolate;
  overflow: hidden;
  background: #e9e6dc;
}

#current {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.masthead {
  position: absolute;
  z-index: 1;
  top: clamp(1.25rem, 3.5vw, 3rem);
  left: clamp(1.25rem, 3.5vw, 3rem);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.8rem;
  pointer-events: none;
}

.index,
.masthead h1,
.instruction,
.status {
  margin: 0;
  text-transform: uppercase;
}

.index {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.masthead h1 {
  font-size: clamp(0.78rem, 1.2vw, 0.98rem);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.instruction {
  position: absolute;
  z-index: 1;
  left: clamp(1.25rem, 3.5vw, 3rem);
  bottom: clamp(4.8rem, 9vw, 6.4rem);
  max-width: 13rem;
  font-size: clamp(0.66rem, 1vw, 0.8rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.controls {
  position: absolute;
  z-index: 2;
  right: clamp(1.25rem, 3.5vw, 3rem);
  bottom: clamp(1.25rem, 3.5vw, 3rem);
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(22, 23, 19, 0.75);
  background: rgba(233, 230, 220, 0.84);
  backdrop-filter: blur(6px);
}

.controls button {
  min-width: 5.2rem;
  min-height: 2.7rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-right: 1px solid rgba(22, 23, 19, 0.75);
  border-radius: 0;
  color: #161713;
  background: transparent;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.controls button:last-child {
  border-right: 0;
}

.controls button:hover {
  background: #161713;
  color: #f3f0e7;
}

.controls button:disabled {
  color: rgba(22, 23, 19, 0.5);
  background: transparent;
  cursor: default;
}

.controls button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid #f04331;
  outline-offset: 3px;
}

.status {
  position: absolute;
  z-index: 1;
  right: clamp(1.25rem, 3.5vw, 3rem);
  top: clamp(1.25rem, 3.5vw, 3rem);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  pointer-events: none;
}

@media (max-width: 40rem) {
  .stage {
    min-height: 28rem;
  }

  .instruction {
    bottom: 5.6rem;
  }

  .controls {
    left: 1.25rem;
    right: 1.25rem;
  }

  .controls button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .instruction {
    display: none;
  }
}
