:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5efe2;
  color: #171611;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, #fff9 0 6%, transparent 20%),
    linear-gradient(135deg, #f8f1df, #e8dcc6);
}

main {
  display: flex;
  flex-direction: column;
  width: min(1400px, 100%);
  height: 100%;
  margin: auto;
  padding: clamp(10px, 2vw, 20px);
}

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.back { color: #575046; font-size: .78rem; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; }
h1 { margin: 3px 0 0; font-size: clamp(2rem, 5vw, 4.4rem); line-height: .9; letter-spacing: -.07em; text-transform: uppercase; }
.status { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.status span { border: 2px solid #171611; border-radius: 99px; background: #fff9; padding: 7px 11px; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.status .powered { color: #fff; background: #6e3aff; animation: pulse .7s ease-in-out infinite alternate; }

.game-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border: 3px solid #171611;
  border-radius: 18px;
  overflow: hidden;
  background: #27251f;
  box-shadow: 0 12px 0 #1716111d;
}

canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }

.curtain {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #1716118c;
  backdrop-filter: blur(3px);
  transition: opacity .2s;
}
.curtain.hidden { opacity: 0; pointer-events: none; }
.card { width: min(460px, 100%); padding: clamp(20px, 5vw, 38px); text-align: center; border: 3px solid #171611; border-radius: 15px; background: #fffaf0; box-shadow: 8px 8px 0 #171611; }
.eyebrow { margin: 0 0 8px; color: #e24b35; font-size: .72rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: .95; letter-spacing: -.055em; }
.card > p:not(.eyebrow, .keys) { color: #5b554c; line-height: 1.5; }
button { font: inherit; }
#start-button { border: 2px solid #171611; border-radius: 99px; padding: 11px 22px; color: white; background: #171611; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #777066; }
#start-button:hover { transform: translateY(-1px); }
#start-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #777066; }
.keys { margin: 14px 0 0; color: #777066; font-size: .74rem; }

.touch-help { display: none; }

@keyframes pulse { to { filter: hue-rotate(70deg); transform: scale(1.04); } }

@media (pointer: coarse), (max-width: 700px) {
  main { padding: 9px; }
  header { align-items: start; }
  h1 { font-size: clamp(1.8rem, 9vw, 3.2rem); }
  .back { font-size: .65rem; }
  .status { max-width: 150px; }
  .status span { padding: 5px 8px; font-size: .63rem; }
  .desktop-help { display: none; }
  .touch-help { display: inline; }
}

@media (pointer: coarse) and (orientation: landscape) {
  main { padding: 7px 10px; }
  header { position: absolute; z-index: 3; top: 14px; left: 17px; right: 17px; pointer-events: none; }
  header a, header .status { pointer-events: auto; }
  h1 { color: #fffaf0; font-size: 1.6rem; text-shadow: 0 2px 0 #171611; }
  .back { display: none; }
  .status span { background: #fffaf0e6; }
}
