:root {
  --lime: #c6ff00;
  --olive: #9cb410;
  --ink: #0d0d0d;
  --orange: #f08a3c;
  --mono: 'Space Mono', ui-monospace, monospace;
  --black: 'Archivo Black', 'Arial Black', sans-serif;
  --pixel: 'Press Start 2P', 'Space Mono', monospace;
}

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

body {
  background: var(--lime);
  /* faint roblox studs */
  background-image: radial-gradient(circle, rgba(13, 13, 13, 0.05) 26%, transparent 27%);
  background-size: 56px 56px;
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden; /* travel is velocity-driven, not page scroll */
  height: 100vh;
}

/* ============ CHROME ============ */

.mm-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 28px 4.5vw;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35em;
  z-index: 20;
}

.mm-back { color: var(--ink); text-decoration: none; }
.mm-back:hover { text-decoration: underline; }

.mm-hint {
  position: fixed;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.3em;
  opacity: 0.65;
  z-index: 20;
  animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse { 50% { opacity: 0.3; } }

/* ============ THE MEME DIMENSION ============ */

.space {
  position: fixed;
  inset: 0;
  perspective: 900px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  z-index: 5;
}

.sp-item {
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
}

.sp-card {
  cursor: pointer;
  pointer-events: auto;
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px #fff, 8px 10px 0 4px rgba(13, 13, 13, 0.28);
  background: #fff;
}

.sp-card img {
  display: block;
  width: 240px;
  max-height: 240px;
  object-fit: cover;
}

.sp-card:hover { filter: brightness(1.08); }

.sp-word {
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.sp-word.w-big { font-family: var(--black); font-size: 64px; text-transform: uppercase; }
.sp-word.w-pix { font-family: var(--pixel); font-size: 18px; }
.sp-word.w-ink { color: var(--ink); }
.sp-word.w-olive { color: var(--olive); }
.sp-word.w-orange { color: var(--orange); }
.sp-word.w-white { color: #fff; text-shadow: 3px 3px 0 var(--ink); }

/* ============ EDITOR ============ */

.editor {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.92);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.editor[hidden] { display: none; }

.editor-card {
  position: relative;
  background: var(--lime);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px #fff, 10px 12px 0 4px rgba(0, 0, 0, 0.5);
  padding: 26px;
  width: min(560px, 94vw);
  max-height: 94vh;
  overflow-y: auto;
}

.ed-kicker {
  font-family: var(--pixel);
  font-size: 11px;
  margin-bottom: 14px;
}

.ed-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--lime);
  border: none;
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
}

.ed-frame {
  position: relative;
  border: 4px solid var(--ink);
  background: #000;
  overflow: hidden;
}

.ed-frame img {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
}

.cap {
  position: absolute;
  left: 4%;
  right: 4%;
  text-align: center;
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(20px, 5.5vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
  pointer-events: none;
  word-break: break-word;
}

.cap-top { top: 3%; }
.cap-bot { bottom: 3%; }

.ed-input {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px 14px;
  font-family: var(--pixel);
  font-size: 11px;
  background: #fff;
  border: 4px solid var(--ink);
  outline: none;
}

.ed-input:focus { box-shadow: 4px 4px 0 0 var(--ink); }

.ed-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.ed-btn {
  flex: 1;
  padding: 16px 10px;
  font-family: var(--pixel);
  font-size: 11px;
  background: var(--ink);
  color: var(--lime);
  border: 4px solid var(--ink);
  cursor: pointer;
}

.ed-btn:hover { background: #2a2a2a; }

.ed-btn-alt { background: #fff; color: var(--ink); }
.ed-btn-alt:hover { background: #e8e8e8; }

.ed-status {
  margin-top: 12px;
  font-family: var(--pixel);
  font-size: 9px;
  min-height: 14px;
  letter-spacing: 0.05em;
}
