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

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 24% 18%, rgba(115, 39, 62, 0.34), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(39, 97, 76, 0.22), transparent 30%),
    linear-gradient(160deg, #08090c 0%, #11130f 55%, #07080a 100%);
  overflow-x: hidden;
}

button {
  border: 0;
  color: #1c1209;
  background: #f2b35f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    background 160ms ease;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 8px;
  color: #1c1209;
  background: #ffd48b;
  font-weight: 900;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-bar,
.portal-footer {
  width: min(1220px, calc(100vw - 28px));
  margin: 0 auto;
  color: #f7efe0;
}

.portal-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
}

.brand {
  font-weight: 950;
  text-decoration: none;
}

.portal-bar nav,
.portal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-bar a,
.portal-footer a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(247, 239, 224, 0.18);
  border-radius: 8px;
  text-decoration: none;
  background: rgba(5, 6, 8, 0.46);
}

.portal-footer {
  padding: 0 0 18px;
}

.game-shell {
  width: min(1220px, calc(100vw - 28px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
}

.game-panel {
  position: relative;
  border: 1px solid rgba(247, 239, 224, 0.18);
  background: rgba(5, 6, 8, 0.66);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border-radius: 8px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(247, 239, 224, 0.12);
}

.hud > div {
  min-width: 0;
  padding: 12px 14px;
  background: rgba(9, 12, 14, 0.9);
}

.hud-label {
  display: block;
  color: #aeb8a8;
  font-size: 12px;
  line-height: 1.2;
}

.hud strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(17px, 2vw, 22px);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #090b0d;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(16, 13, 10, 0.28), rgba(0, 0, 0, 0.82)),
    linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.66));
}

.overlay.hidden {
  display: none;
}

.cover-art {
  width: min(540px, 86vw);
  aspect-ratio: 16 / 9;
  justify-self: center;
  object-fit: cover;
  border: 4px solid rgba(247, 239, 224, 0.18);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48);
}

.overlay h1 {
  margin: 0;
  color: #ffd48b;
  font-size: clamp(34px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.overlay p {
  width: min(620px, 88vw);
  margin: 0 auto;
  color: #f3dfc5;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
}

.overlay button {
  width: min(260px, 80vw);
  min-height: 52px;
  justify-self: center;
  border-radius: 8px;
  font-size: 18px;
}

.side-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-left: 1px solid rgba(247, 239, 224, 0.18);
}

.side-panel h2 {
  margin: 0 0 4px;
  color: #f2b35f;
  font-size: 24px;
}

.side-panel p {
  margin: 0;
  color: #c8cbbb;
  line-height: 1.45;
}

.touch-controls {
  display: none;
}

@media (max-width: 860px) {
  .portal-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-shell {
    grid-template-columns: 1fr;
    align-content: start;
    padding-top: 12px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid rgba(247, 239, 224, 0.18);
    padding: 16px 4px 0;
  }

  .touch-controls {
    display: grid;
    grid-template-columns: repeat(3, 54px);
    grid-template-areas:
      ". up ."
      "left down right";
    gap: 8px;
    justify-content: center;
    padding: 12px;
    background: rgba(9, 12, 14, 0.94);
  }

  .touch-controls button {
    width: 54px;
    height: 46px;
    border-radius: 8px;
  }

  .touch-controls [data-dir="up"] {
    grid-area: up;
  }

  .touch-controls [data-dir="left"] {
    grid-area: left;
  }

  .touch-controls [data-dir="down"] {
    grid-area: down;
  }

  .touch-controls [data-dir="right"] {
    grid-area: right;
  }
}
