* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0d1117;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Segoe UI', sans-serif;
  overflow: hidden;
}
h1 { color: #c9d1d9; font-size: 1.2rem; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 14px; opacity: 0.7; }
#wrap {
  position: relative;
  display: inline-block;
}
canvas {
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(80,120,255,0.25);
  width: min(95vw, calc((100vh - 80px) * 760 / 420));
  height: min(calc(95vw * 420 / 760), calc(100vh - 80px));
}
#fs {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  padding: 6px;
  cursor: pointer;
  line-height: 0;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}
#fs:hover { background: rgba(0,0,0,0.7); color: #fff; }
#fs:active { transform: scale(0.92); }

/* Fullscreen: canvas fills the screen */
#wrap:fullscreen, #wrap:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  width: 100%; height: 100%;
}
#wrap:fullscreen canvas, #wrap:-webkit-full-screen canvas {
  width: min(100vw, calc(100vh * 760 / 420));
  height: min(calc(100vw * 420 / 760), 100vh);
  border-radius: 0;
  box-shadow: none;
}

@media (max-height: 500px) {
  h1 { display: none; }
  canvas {
    width: min(98vw, calc(98vh * 760 / 420));
    height: min(calc(98vw * 420 / 760), 98vh);
  }
}

@media (max-width: 500px) {
  h1 { font-size: 0.9rem; margin-bottom: 8px; }
  canvas {
    width: min(98vw, calc((100vh - 50px) * 760 / 420));
    height: min(calc(98vw * 420 / 760), calc(100vh - 50px));
  }
}
