:root {
  --background: #000;
  --foreground: #fff;
  --text: #e0e0e0;
  --accent: #4fd1ff;
  --font: "Segoe UI", "Arial", "Helvetica Neue", Arial, sans-serif;
}
html,
body {
  margin: 0px;
  padding: 0px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--background);
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  color: var(--foreground);
  font-family: var(--font);
  font-size: 1.1rem;
  background: var(--background);
}
.container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  width: 80%;
  height: 80%;
  max-width: 1300px;
  background: rgba(20, 20, 20, 0.92);
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.7);
  padding: 2.5rem 2rem 2rem 2rem;
  gap: 2.5rem;
}
.description {
  flex: 1.1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 95%;
  height: 95%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #242424;
  scrollbar-gutter: stable;
  padding-right: .6rem;
}
h1 {
  color: var(--foreground);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px #222;
  margin-top: 0;
  margin-bottom: 1.2rem;
}
p {
  color: var(--text);
  line-height: 1.6;
  margin: 0.7rem 0;
  text-align: left;
  font-size: 1.13rem;
}
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
a:hover {
  color: var(--foreground);
  text-decoration: underline;
}
li {
  font-size: 1rem;
  line-height: 1.6;
}
li + li { margin-top: .45rem; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: .05em .35em;
  border: 1px solid #666;
  border-bottom-width: 3px;
  border-radius: 4px;
  background: #282828;
  color: var(--foreground);
  font: .85em/1.4 monospace;
  text-align: center;
}
.canvas-container {
  flex: 1.7 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 95%;
  height: 95%;
}
canvas {
  margin: 0px auto;
  padding: 20px;
  width: 95%;
  height: 95%;
  background: var(--background);
  z-index: 0;
  border-radius: 10px;
  box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.6);
  display: block;
}

/* Error-page variation of the same typography and colours. */
body.pong-error { min-height: 100svh; height: auto; width: auto; box-sizing: border-box; padding: 24px; }
.pong-error .court { box-sizing: border-box; position: relative; width: min(100%, 900px); min-height: 440px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--foreground); background: #050505; }
.pong-error .court::before { position: absolute; inset: 0 50% 0 auto; border-left: 2px dashed #777; content: ""; }
.pong-error .paddle { position: absolute; width: 10px; height: 90px; background: var(--foreground); animation: drift 2.4s ease-in-out infinite alternate; }
.pong-error .paddle.left { left: 34px; top: 25%; }
.pong-error .paddle.right { right: 34px; bottom: 22%; animation-delay: -1.2s; }
.pong-error .message { position: relative; z-index: 1; max-width: 520px; padding: 38px; text-align: center; background: #000d; }
.pong-error h1 { margin: 0; font-size: clamp(32px, 5vw, 40px); line-height: 1.15; letter-spacing: normal; text-shadow: none; }
.pong-error p { margin: 18px 0 0; text-align: center; }
.pong-error .message a { display: inline-block; margin-top: 26px; font-weight: 700; }
@keyframes drift { to { transform: translateY(120px); } }
@media (prefers-reduced-motion: reduce) { .pong-error .paddle { animation: none; } }

@media (max-width: 800px) {
  html, body { height: auto; overflow: visible; }
  body { min-height: 100svh; width: auto; }
  .container { box-sizing: border-box; flex-direction: column; width: calc(100% - 24px); height: auto; margin: 12px; padding: 24px 16px; gap: 24px; }
  .description { flex: none; width: 100%; height: auto; overflow: visible; padding: 0; }
  .canvas-container { flex: none; width: 100%; height: auto; }
  canvas { box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 1; padding: 0; }
}
