/* Nullity web template: the game fills the window; while it loads, the
   opening picture with the logo in its sky and a cut-corner progress bar —
   the same plate the game draws next (UIRoot.BuildLoading), at the same place. */
@font-face { font-family: "BarlowCondensed"; src: url("BarlowCondensed-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --ink: #070b10;
  --text: #f3f6f8;
  --dim: rgba(243, 246, 248, 0.62);
  --faint: rgba(243, 246, 248, 0.34);
  --accent: #46e0c2;
  --accent-deep: #1fb89c;
  --edge: rgba(255, 255, 255, 0.14);
  --coral: #ff5a5f;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: "Barlow", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--ink);
  outline: none;
  touch-action: none;
}

/* ---- loading ---------------------------------------------------------- */

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12vh !important;
  /* The opening picture (nullity_background.png, Tools/Branding/make_brand.py). */
  background:
    linear-gradient(180deg, rgba(5, 8, 20, 0) 66%, rgba(5, 8, 20, 0.78) 100%),
    url("background.jpg") center / cover no-repeat,
    #0b0d18;
  transition: opacity 0.6s ease;
  z-index: 10;
  padding: 0 16px;
  box-sizing: border-box;
}
#loading.done { opacity: 0; pointer-events: none; }

/* The logo: 15 % from the top, 38 % of the height (UIRoot.LoadingLogoTop/Height). */
#loading .mark {
  position: absolute;
  top: 15vh;
  left: 50%;
  height: 38vh;
  width: auto;
  max-width: 86vw;
  object-fit: contain;
  transform: translateX(-50%);
}

/* The bar: a cut-corner glass track with a mint fill. */
#loading .bar {
  margin-top: 44px;
  width: min(420px, 78vw);
  height: 14px;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
#loading .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--edge);
  clip-path: inherit;
  pointer-events: none;
}
#loading .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 14px rgba(70, 224, 194, 0.45);
  transition: width 0.25s ease-out;
}

#loading .status {
  margin-top: 14px;
  min-height: 20px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-align: center;
  max-width: 78vw;
}
#loading .status.error { color: var(--coral); }

#loading .foot {
  position: absolute;
  bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ---- messages from the engine (warnings, errors) ------------------------ */

#banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(640px, 92vw);
}
#banner div {
  padding: 10px 16px;
  background: rgba(12, 18, 26, 0.92);
  border-left: 3px solid var(--accent);
  font-size: 14px;
}
#banner div.error { border-left-color: var(--coral); }

/* ---- full screen -------------------------------------------------------- */

#fullscreen {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  z-index: 15;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 18, 26, 0.55);
  border: 1px solid var(--edge);
  color: var(--dim);
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
#fullscreen:hover { opacity: 1; color: var(--accent); }
#fullscreen svg { width: 18px; height: 18px; }
body.playing #fullscreen { display: flex; }

/* ---- PuPue sign-in with Google (pupue-session.js), over the game ------- */

#signin {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(4, 7, 12, 0.62);
  backdrop-filter: blur(6px);
}
#signin .sg-card {
  width: min(440px, 100%);
  box-sizing: border-box;
  padding: 26px 28px 22px;
  background: rgba(10, 16, 22, 0.94);
  border: 1px solid var(--edge);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow: inset 0 2px 0 var(--accent);
}
#signin .sg-cap {
  font-family: "BarlowCondensed", "Barlow", sans-serif;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
#signin h2 {
  margin: 8px 0 0;
  font-family: "BarlowCondensed", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#signin p { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: var(--dim); }
#signin .sg-button { margin-top: 20px; min-height: 44px; display: flex; justify-content: center; }
#signin.busy .sg-button { opacity: 0.4; pointer-events: none; }
#signin .sg-error { margin-top: 12px; font-size: 14px; color: var(--coral); }
#signin .sg-close {
  margin-top: 18px;
  width: 100%;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--edge);
  color: var(--dim);
  font: 700 15px/1 "BarlowCondensed", "Barlow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
#signin .sg-close:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
