/*
 * Coop Coup page shell — lives next to index.html (not under theme/) so
 * `npm run build:web` does not delete it when syncing love.js theme output.
 */

html {
  min-height: 100%;
  width: 100%;
  max-width: none;
  overflow-x: hidden;
  background-color: #050608;
}

body.coop-game-page {
  width: 100%;
  max-width: none;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  /* Let the decorative halo sit *behind* content (see .splash-halo below). */
  background-color: transparent;
}

/* Ambient halo must paint under the game, not over the canvas (fixed + transforms can composite high). */
body.coop-game-page .splash-halo {
  z-index: -1;
}

.coop-game-page .coop-game-header {
  justify-content: flex-start;
}

.coop-back-btn {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 0.55rem 1rem;
}

.coop-game-page .coop-game-main {
  position: relative;
  z-index: 2;
  isolation: isolate;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  padding-top: var(--splash-nav-h, 3rem);
  padding-bottom: 0.5rem;
  box-sizing: border-box;
}

.coop-game-page .coop-game-stack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  padding: clamp(0.35rem, 1vw, 0.75rem) clamp(0.25rem, 1.5vw, 1rem) 0;
  gap: 0.75rem;
  box-sizing: border-box;
}

.coop-game-page .coop-canvas-wrap {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  /* Taller floor so wide viewports get more vertical room for 1200×800 (object-fit: contain). */
  min-height: min(94dvh, calc(100dvh - var(--splash-nav-h, 3rem) - 3.75rem));
  display: flex;
  flex-direction: column;
  /* Horizontal center when canvas buffer is narrower than the wrap; top-align vertically. */
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
}

/*
 * Stack both canvases. love.js resets the backing store to conf.lua (e.g. 1200×800)
 * after load, so the buffer can be narrower than the wrap — scale the element to
 * fill the wrap and letterbox inside it (avoids a stuck left margin / one-sided gap).
 */
.coop-game-page .coop-canvas-wrap #loadingCanvas,
.coop-game-page .coop-canvas-wrap #canvas {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  border: 0 none;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center center;
  /* Nearest-style upscale when the shell letterboxes a capped backing store (index.html). */
  image-rendering: pixelated;
}

.coop-game-page .coop-canvas-wrap #loadingCanvas {
  z-index: 2;
}

.coop-game-page .coop-canvas-wrap #canvas {
  z-index: 1;
}

.coop-game-page #canvas {
  visibility: hidden;
}

.coop-about {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  padding: 1.5rem 1rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(5, 6, 8, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.coop-about__inner {
  max-width: 42rem;
  margin: 0 auto;
}

.coop-about__eyebrow {
  margin: 0 0 0.5rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(57, 255, 20, 0.75);
}

.coop-about__title {
  margin: 0 0 1rem;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  letter-spacing: -0.02em;
  color: #e8eaef;
}

.coop-about__p {
  margin: 0 0 1rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(232, 234, 239, 0.88);
}

.coop-about__p:last-child {
  margin-bottom: 0;
}

.coop-about__p--note {
  font-size: 0.88rem;
  color: rgba(232, 234, 239, 0.72);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.coop-game-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  padding: 1rem 1rem 1.25rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  color: rgba(232, 234, 239, 0.72);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(5, 6, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.coop-game-footer a {
  color: rgba(57, 255, 20, 0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.coop-game-footer a:hover {
  color: #39ff14;
}

.coop-fs-btn {
  margin-left: 0.5rem;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.65rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
