:root {
  --seam-cyan: rgba(95, 244, 255, 0.92);
  --seam-cyan-soft: rgba(95, 244, 255, 0.34);
  --seam-white: rgba(244, 251, 255, 0.94);
  --seam-dim: rgba(190, 222, 230, 0.68);
  --seam-black: #010406;
}

body.is-seam-demo {
  background: #010406;
  color: var(--seam-white);
  overflow: hidden;
}

body.is-seam-demo .gh-head,
body.is-seam-demo .gh-foot {
  display: none !important;
}

body.is-seam-demo .gh-site {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 70% 18%, rgba(80, 240, 255, 0.08), transparent 34rem),
    radial-gradient(circle at 20% 80%, rgba(255, 80, 210, 0.06), transparent 30rem),
    #010406;
}

.seam-page,
.seam-stage {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
}

.seam-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  isolation: isolate;
}

.seam-topline {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 46px;
  padding: 0.55rem clamp(0.7rem, 1.6vw, 1.2rem);
  pointer-events: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--seam-white);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 18px rgba(77, 238, 255, 0.2);
}

.seam-topline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 7, 10, 0.78), rgba(0, 7, 10, 0.22), transparent);
  pointer-events: none;
}

.seam-site-mark,
.seam-corner-actions button {
  pointer-events: auto;
}

.seam-site-mark {
  color: var(--seam-dim);
  font-size: 0.72rem;
  text-decoration: none;
  border: 1px solid rgba(95, 244, 255, 0.24);
  border-radius: 999px;
  padding: 0.28rem 0.5rem;
  background: rgba(0, 10, 14, 0.38);
}

.seam-site-mark:hover,
.seam-corner-actions button:hover {
  color: var(--seam-white);
  border-color: rgba(95, 244, 255, 0.56);
}

.seam-title-lockup {
  line-height: 1;
}

.seam-title-lockup h1 {
  margin: 0;
  font-size: clamp(0.9rem, 1.7vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.28em;
}

.seam-title-lockup p {
  margin: 0.18rem 0 0;
  font-size: 0.58rem;
  color: rgba(210, 236, 240, 0.6);
  letter-spacing: 0.2em;
}

.seam-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  font-size: 0.62rem;
  color: rgba(220, 244, 250, 0.72);
}

.seam-controls span {
  padding: 0.2rem 0.42rem;
  border: 1px solid rgba(95, 244, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 10, 14, 0.26);
}

.seam-frame-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.seam-game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  touch-action: none;
}

.seam-frame-wrap.seam-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 9999;
}

.seam-focus-veil {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(90, 245, 255, 0.14), transparent 14rem),
    rgba(0, 0, 0, 0.42);
  color: var(--seam-white);
  cursor: pointer;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-shadow: 0 0 16px #000;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.seam-focus-veil span {
  font-size: clamp(0.8rem, 2vw, 1.2rem);
}

.seam-focus-veil small {
  font-size: 0.62rem;
  color: rgba(220, 244, 250, 0.7);
}

.seam-is-focused .seam-focus-veil {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.seam-corner-actions {
  position: fixed;
  z-index: 22;
  right: clamp(0.7rem, 1.6vw, 1.2rem);
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: flex;
  gap: 0.45rem;
}

.seam-corner-actions button {
  color: rgba(220, 244, 250, 0.72);
  border: 1px solid rgba(95, 244, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 10, 14, 0.36);
  backdrop-filter: blur(8px);
  padding: 0.38rem 0.58rem;
  font: 600 0.62rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.seam-noscript {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 50;
  color: #fff;
}

@media (max-width: 760px) {
  .seam-topline {
    grid-template-columns: auto 1fr;
    row-gap: 0.28rem;
    min-height: 52px;
  }

  .seam-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 0.28rem;
    font-size: 0.54rem;
  }

  .seam-title-lockup h1 {
    font-size: 0.9rem;
  }

  .seam-corner-actions {
    transform: scale(0.92);
    transform-origin: right bottom;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  .seam-stage::after {
    content: "rotate for the seam";
    position: fixed;
    z-index: 25;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    color: rgba(235, 250, 255, 0.72);
    font: 600 0.62rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 0 12px #000;
    pointer-events: none;
  }
}
