@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

:root {
  --paper: #f6f2e8;
  --grid: #b8c6e6;
  --ink: #1c1b19;
  --accent: #d8483e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--paper);
  background-image: url('img/lined_paper-tiled.jpg');
  background-repeat: repeat;
  background-size: 900px auto;
  color: var(--ink);
  font-family: 'Patrick Hand', system-ui, sans-serif;
}

#game {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

canvas {
  display: block;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 15, 14, 0.85);
}

.gate-panel {
  width: min(92vw, 420px);
  padding: 24px;
  border: 2px solid #1c1b19;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.gate-panel h1 {
  margin: 0 0 8px;
}

.gate-panel p {
  margin: 0 0 14px;
}

#gate-form {
  display: flex;
  gap: 8px;
}

#gate-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #1c1b19;
  border-radius: 8px;
  font: inherit;
}

#gate-form button {
  padding: 10px 14px;
  border: 1px solid #1c1b19;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.gate-error {
  min-height: 1.2em;
  margin-top: 10px;
  color: #a62a21;
}
