:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #17171a;
  color: #f4f1e8;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(214, 78, 68, 0.18), transparent 28rem),
    linear-gradient(135deg, #17171a 0%, #202329 48%, #111215 100%);
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  min-height: 100vh;
  padding: 22px;
  align-items: center;
}

.arena-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
}

canvas {
  display: block;
  width: min(100%, calc((100vh - 44px) * 16 / 9));
  max-height: calc(100vh - 44px);
  aspect-ratio: 16 / 9;
  border: 2px solid rgba(244, 241, 232, 0.18);
  background: #111;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
  image-rendering: auto;
}

.panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}

.tagline,
.note {
  margin: 0;
  color: #d9d0bf;
  line-height: 1.45;
}

.keys {
  display: grid;
  gap: 12px;
  margin: 0;
}

.keys div {
  padding: 12px 0;
  border-top: 1px solid rgba(244, 241, 232, 0.16);
}

dt {
  color: #f2b46d;
  font-weight: 700;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  color: #f4f1e8;
}

.touch-controls {
  display: none;
}

@media (max-width: 900px) {
  body {
    min-height: 100svh;
  }

  .shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
    padding: 12px;
    align-content: start;
  }

  canvas {
    width: 100%;
    max-height: none;
  }

  .panel {
    align-self: auto;
    gap: 12px;
  }

  h1 {
    font-size: 30px;
  }

  .keys {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
  }
}

@media (pointer: coarse) {
  .arena-wrap {
    gap: 10px;
  }

  .touch-controls {
    display: flex;
    justify-content: space-between;
    width: min(100%, 960px);
    gap: 16px;
  }

  .pad,
  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(58px, 1fr));
    gap: 8px;
  }

  .touch-controls button {
    min-height: 44px;
    border: 1px solid rgba(244, 241, 232, 0.22);
    border-radius: 8px;
    background: rgba(244, 241, 232, 0.1);
    color: #f4f1e8;
    font-weight: 700;
  }
}
