/* REJACK entrance: dark, quiet, lets the grid speak. */

:root {
  --teal: #5eead4;
  --teal-dim: #8ad8c8;
  --ink: #e8fffa;
  --panel: rgba(5, 10, 9, 0.78);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050607;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
}

#stage canvas {
  display: block;
  touch-action: none;
}

/* Loading veil ---------------------------------------------------------- */

#rejack-loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #050607;
  z-index: 30;
}

#rejack-loading[hidden] { display: none; }

#rejack-loading .wordmark {
  color: var(--teal);
  letter-spacing: 0.45em;
  font-size: 28px;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Entrance panel --------------------------------------------------------- */

#entrance-ui {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 16px;
  padding: 18px 20px 14px;
  text-align: center;
  z-index: 20;
  backdrop-filter: blur(8px);
}

#entrance-ui[hidden] { display: none; }

.preview-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #050607;
  background: var(--teal);
  border-radius: 999px;
  padding: 5px 14px 5px 18px;
  font-weight: 700;
}

.preview-line {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--teal-dim);
}

.save-label {
  margin: 14px 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dim);
}

.save-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.save-note {
  font-size: 12px;
  color: #6b8f88;
  margin: 8px 0 0;
}

.save-option {
  appearance: none;
  border: 1px solid rgba(94, 234, 212, 0.45);
  background: rgba(94, 234, 212, 0.08);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.save-option:hover {
  background: rgba(94, 234, 212, 0.18);
}

.linklike {
  appearance: none;
  background: none;
  border: none;
  color: var(--teal-dim);
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
}

#enter-button {
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #050607;
  background: var(--teal);
  cursor: pointer;
}

#enter-button:hover { filter: brightness(1.08); }

#enter-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--teal-dim);
}

#enter-note[hidden] { display: none; }

#privacy-line {
  margin: 14px 0 0;
  font-size: 12px;
  color: #6b8f88;
  line-height: 1.5;
}

#privacy-line[hidden] { display: none; }

#privacy-line button {
  appearance: none;
  background: none;
  border: 1px solid #2c4a44;
  color: var(--teal-dim);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
}

.entrance-footer {
  margin-top: 10px;
  font-size: 12px;
  color: #4a5f5a;
}

.entrance-footer a {
  color: var(--teal-dim);
  text-decoration: none;
}

.entrance-footer a[hidden] { display: none; }

/* Small screens: the panel stays compact, the world stays visible. */
@media (max-height: 560px) {
  #entrance-ui { padding: 12px 16px 10px; }
  .preview-line, #privacy-line { display: none; }
}
