/* Bundled pixel font (offline; SIL OFL 1.1 — see assets/fonts/jersey10-OFL.txt). English-only. */
@font-face {
  font-family: 'Jersey 10';
  src: url('../assets/fonts/jersey10.ttf') format('truetype');
  font-display: block;
}

/* Chat body font (offline; SIL OFL 1.1 — see assets/fonts/pretendard-OFL.txt). Korean-capable,
   unlike the pixel display font — used by the chat overlay so free-text (incl. Hangul) is legible. */
@font-face {
  font-family: 'Pretendard';
  src: url('../assets/fonts/pretendard-regular.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0d17;
  /* Prevent the browser from hijacking touch gestures (scroll/zoom) during play. */
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

/* The canvas fills its container; main.js sizes the backing store (DPR-aware) and the game
   lays out from the live view size, so it fills any container and aspect ratio. */
#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  /* Keep the upscaled virtual framebuffer crisp (8-bit look). */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* -------------------------------------------------------------------------
   Shared pixel-modal kit (.auth-*): DOM overlays on top of the canvas, styled
   to keep the pixel-art look in the Jersey 10 font. Used by authForm.js (login
   / signup / verify) and domPrompts.js (message + name-entry prompts). Colors
   mirror the game palette (palette.js): panel #1a1430, inset #0d0a1e, text
   #f8f8f8, accent #f8d838, muted label #8a9ac0, ink #101820.
   ------------------------------------------------------------------------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  font-family: 'Jersey 10', monospace;
  -webkit-user-select: none;
  user-select: none;
}
.auth-panel {
  box-sizing: border-box;
  width: min(82vw, 360px);
  max-height: 92vh;
  overflow-y: auto;
  padding: clamp(16px, 5vw, 28px);
  display: flex;
  flex-direction: column;
  background: #1a1430;
  border: 2px solid #0d0a1e;
  border-radius: 2px;
  color: #f8f8f8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-title {
  margin: 0 0 clamp(10px, 3vw, 18px);
  text-align: center;
  color: #f8d838;
  font-weight: 400;
  font-size: clamp(28px, 9vw, 40px);
  line-height: 1;
}
.auth-hint {
  margin: 0;
  text-align: center;
  color: #8a9ac0;
  font-size: clamp(15px, 4.5vw, 19px);
  line-height: 1.1;
}
.auth-hint-email {
  margin: 2px 0 clamp(8px, 2vw, 12px);
  text-align: center;
  color: #f8f8f8;
  font-size: clamp(16px, 5vw, 21px);
  line-height: 1.1;
  word-break: break-all;
}
/* MessagePrompt body copy (message above the choice buttons). */
.auth-msg {
  margin: 0 0 clamp(14px, 4vw, 22px);
  text-align: center;
  color: #f8f8f8;
  font-size: clamp(20px, 6vw, 26px);
  line-height: 1.2;
}
.auth-field {
  display: flex;
  flex-direction: column;
  margin-bottom: clamp(8px, 2.5vw, 14px);
}
.auth-label {
  margin-bottom: 3px;
  color: #8a9ac0;
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1;
}
.auth-input {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(6px, 2vw, 10px) 8px;
  background: #0d0a1e;
  border: 2px solid #2a2348;
  border-radius: 2px;
  color: #f8f8f8;
  font-family: 'Jersey 10', monospace;
  font-size: clamp(20px, 6vw, 26px);
  line-height: 1;
  letter-spacing: 0.06em;
  outline: none;
}
.auth-input:focus { border-color: #f8d838; }
.auth-err {
  margin: clamp(4px, 1.5vw, 8px) 0 0;
  text-align: center;
  color: #ff7a7a;
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.15;
}
.auth-primary {
  margin-top: clamp(12px, 3.5vw, 18px);
  padding: clamp(8px, 2.5vw, 12px);
  background: #f8d838;
  border: none;
  border-radius: 2px;
  color: #101820;
  font-family: 'Jersey 10', monospace;
  font-size: clamp(22px, 6.5vw, 28px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.auth-primary:disabled { opacity: 0.5; cursor: default; }
/* Code view: the input and VERIFY button share one row. */
.auth-inline {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.auth-inline .auth-input {
  flex: 1 1 auto;
  min-width: 0;
}
.auth-primary-inline {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  padding: clamp(6px, 2vw, 10px) clamp(12px, 4vw, 18px);
  font-size: clamp(18px, 5vw, 22px);
}
.auth-links {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 4vw, 20px);
  margin-top: clamp(10px, 3vw, 16px);
}
.auth-link {
  padding: 4px;
  background: none;
  border: none;
  color: #8a9ac0;
  font-family: 'Jersey 10', monospace;
  font-size: clamp(16px, 4.5vw, 20px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.auth-link:hover { color: #f8f8f8; }
