/* ═══════════════════════════════════════════════════════════════
   THE CESSPOOL — xespool.com
   A sealed copy of the Wildcard lobby. Self-contained: no backend,
   no auth, no partner. The call connects you to yourself.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:        #080808;
  --panel:     #0e0e0e;
  --ink:       #ebebeb;
  --muted:     #888;
  --dim:       #555;
  --acid:      #f02070;
  --acid-dim:  rgba(240, 32, 112, 0.5);
  --line:      rgba(255, 255, 255, 0.08);
}

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

html { overflow-x: hidden; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* lock horizontal: the orb's VU canvas bleeds past the edges and iOS will
     otherwise pan the page sideways while you're dragging a fader. */
  overflow-x: hidden;
  max-width: 100vw;
  touch-action: pan-y;
  position: relative;
}

/* faint sick-green wash so the "pool" reads as water, not void */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 120%, rgba(60, 110, 70, 0.10), transparent 60%),
    radial-gradient(40% 50% at 50% -10%, rgba(240, 32, 112, 0.06), transparent 60%);
  z-index: 0;
}

/* ── Gate ─────────────────────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: #060606;
  text-align: center;
  padding: 2rem;
  transition: opacity .8s ease;
}
.gate.gone { opacity: 0; pointer-events: none; }
.gate-inner { max-width: 30rem; }
.gate-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  color: var(--acid);
  margin-bottom: 1.4rem;
  animation: flicker 4s infinite;
}
.gate-title {
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 0.92;
  margin-bottom: 1.4rem;
}
.gate-sub { color: var(--muted); font-size: 1rem; line-height: 1.7; margin-bottom: 1rem; }
.gate-fine { color: var(--dim); font-size: 0.85rem; font-style: italic; }
.gate-btn {
  margin-top: 1.6rem;
  background: var(--acid);
  color: #fff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.95rem 2.6rem;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}
.gate-btn:hover { opacity: 0.9; }
.gate-btn:active { transform: translateY(1px); }
.gate [hidden] { display: none !important; }
/* Prominent route out, on the locked wall. */
.gate-cta {
  display: inline-block;
  margin-top: 1.8rem;
  background: var(--acid);
  color: #fff;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.95rem 2.4rem;
  transition: opacity .2s ease, transform .2s ease;
}
.gate-cta:hover { opacity: 0.9; }
.gate-cta:active { transform: translateY(1px); }
.gate-locked .gate-kicker { color: var(--dim); animation: none; }
.gate-invite { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin: 1.4rem 0 1.1rem; }
.gate-invite a { color: var(--acid); text-decoration: none; border-bottom: 1px solid var(--acid-dim); }
.gate-invite a:hover { opacity: 0.85; }
.gate-fineprint {
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.6;
  max-width: 34rem;
  margin: 2.2rem auto 0;
  text-align: left;
}

/* ── Room ─────────────────────────────────────────────────────── */
.cess {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.6rem;
  padding: 2rem 1.25rem;
}

/* orb = the lobby avatar-ring, possessed */
.orb-stage {
  position: relative;
  width: min(74vw, 340px);
  height: min(74vw, 340px);
  display: grid; place-items: center;
}
.orb-vu {
  position: absolute; inset: -28%;
  width: 156%; height: 156%;
  pointer-events: none;
}
.orb {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: transform .08s linear;
  will-change: transform;
}
.orb-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.orb-ring-1 { inset: 0;   box-shadow: 0 0 60px rgba(240,32,112,0.10) inset; }
.orb-ring-2 { inset: 14%; border-color: rgba(240,32,112,0.18); }
.orb-ring-3 { inset: 30%; border-color: rgba(255,255,255,0.05); }
.orb-core {
  width: 46%; height: 46%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, rgba(240,32,112,0.55), rgba(120,16,56,0.35) 55%, rgba(8,8,8,0.9) 100%);
  box-shadow: 0 0 50px rgba(240,32,112,0.30), 0 0 120px rgba(240,32,112,0.12);
  animation: breathe 5.5s ease-in-out infinite;
}
.cess.live .orb-core { animation-duration: 2.4s; }

@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; } 94% { opacity: 0.3; } 96% { opacity: 1; } 97% { opacity: 0.5; } 98% { opacity: 1; }
}

/* ── Hint ─────────────────────────────────────────────────────── */
.cess-hint {
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
  min-height: 1.4em;
  max-width: 34rem;
  transition: color .4s ease;
}
.hint-em { color: var(--acid); font-weight: 700; }
.cess.live .cess-hint { color: var(--ink); }

/* ── Call pill ────────────────────────────────────────────────── */
.cess-pill {
  display: flex; align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.pill-call {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--acid);
  color: #fff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.8rem;
  cursor: pointer;
  transition: opacity .2s ease, background .3s ease;
}
.pill-call:hover { opacity: 0.92; }
.pill-ico svg { width: 18px; height: 18px; display: block; }
.cess.live .pill-call { background: #2a2a2a; }
.pill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px;
  background: transparent;
  border: none; border-left: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.pill-icon:hover:not(:disabled) { color: var(--ink); background: rgba(255,255,255,0.03); }
.pill-icon:disabled { opacity: 0.35; cursor: default; }
.pill-icon svg { width: 20px; height: 20px; display: block; }
.pill-icon .mic-off { display: none; }
.pill-icon.muted .mic-on  { display: none; }
.pill-icon.muted .mic-off { display: block; color: var(--acid); }

/* ── Effects rack ─────────────────────────────────────────────── */
/* Flex-wrap (not a rigid grid) so it reflows to any width and can never push
   wider than the screen — the cause of the mobile side-to-side wobble. */
.rack {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center;
  gap: 0.9rem 1.4rem;
  width: 100%; max-width: 40rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  background: rgba(14, 14, 14, 0.6);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity .6s ease;
}
.cess.live .rack { opacity: 1; pointer-events: auto; }
.fx { display: flex; align-items: center; gap: 0.6rem; max-width: 100%; }
.fx-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  width: 3.4rem;
}
.fx-readout {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  color: var(--dim);
  min-width: 4.2rem;
}
.fx-select {
  background: #080808;
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.4rem;
  width: 128px;
  cursor: pointer;
  outline: none;
}
.fx-select:focus { border-color: var(--acid-dim); }
.rack input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 128px; max-width: 52vw; height: 3px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  touch-action: none;   /* the fader owns the drag — never scroll the page */
}
.rack input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--acid);
  cursor: pointer;
  box-shadow: 0 0 10px var(--acid-dim);
}
.rack input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--acid);
  cursor: pointer;
}
.fx-select { touch-action: manipulation; }

/* ── Foot ─────────────────────────────────────────────────────── */
.cess-foot {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  min-height: 1em;
}

/* ── Sewage ───────────────────────────────────────────────────── */
.sewage {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 40vh; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.sewage-svg {
  position: absolute; bottom: 0; left: 0;
  width: 200%; height: 100%;
}
.wave { animation: sewageDrift linear infinite; transform-origin: bottom; }
.wave-1 { fill: #2c3a1e; opacity: 0.6;  animation-duration: 13s; }
.wave-2 { fill: #384a26; opacity: 0.5;  animation-duration: 19s; animation-direction: reverse; }
.wave-3 { fill: #46582f; opacity: 0.45; animation-duration: 27s; }
@keyframes sewageDrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.bubble {
  position: absolute; bottom: 4vh;
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(180,200,120,0.5), rgba(70,88,47,0.2));
  opacity: 0; animation: rise linear infinite;
}
.bubble-1 { left: 18%; animation-duration: 9s;  animation-delay: 0s;   }
.bubble-2 { left: 42%; animation-duration: 12s; animation-delay: 3s; width: 6px; height: 6px; }
.bubble-3 { left: 67%; animation-duration: 10s; animation-delay: 6s; width: 11px; height: 11px; }
.bubble-4 { left: 83%; animation-duration: 14s; animation-delay: 2s; }
@keyframes rise {
  0%   { transform: translateY(0)     scale(0.6); opacity: 0; }
  15%  { opacity: 0.7; }
  100% { transform: translateY(-30vh) scale(1.1); opacity: 0; }
}

/* ── Application for Return ────────────────────────────────────── */
.appeal-btn {
  margin-top: 0.4rem;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.appeal-btn:hover { color: var(--ink); border-color: rgba(255,255,255,0.25); }

.appeal-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(0,0,0,0.78);
  padding: 4vh 1rem;
  overflow-y: auto;
}
.appeal-modal[hidden] { display: none; }
.appeal-sheet {
  position: relative;
  width: 100%; max-width: 46rem;
  background: #0d0d0d;
  border: 1px solid var(--line);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 3rem;
}
.appeal-x {
  position: absolute; top: 0.5rem; right: 0.7rem;
  background: none; border: none; color: var(--dim);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.appeal-x:hover { color: var(--ink); }
.appeal-dept {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.28em;
  color: var(--acid); margin-bottom: 0.8rem;
}
.appeal-title {
  font-weight: 900; font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.02em; line-height: 1.1; color: var(--ink);
  margin: 0 0 0.5rem;
}
.appeal-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: var(--dim); margin-bottom: 1.4rem;
}
.appeal-pre, .appeal-fine, .appeal-verdict p {
  color: var(--muted); font-size: 0.92rem; line-height: 1.7;
}
.appeal-pre { margin-bottom: 1.8rem; }
.appeal-fine { font-size: 0.78rem; color: var(--dim); margin: 1.4rem 0; font-style: italic; }
.appeal-form { display: flex; flex-direction: column; gap: 1.4rem; }
.af-row { display: flex; flex-direction: column; gap: 0.45rem; }
.af-q { color: var(--ink); font-size: 0.9rem; line-height: 1.5; font-weight: 600; }
.af-in {
  background: #080808; border: 1px solid var(--line);
  color: var(--ink); font-family: inherit; font-size: 0.9rem;
  padding: 0.6rem 0.7rem; outline: none;
}
.af-in:focus { border-color: var(--acid-dim); }
.af-text { resize: vertical; min-height: 5.5rem; }
.af-hint { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--dim); }
.af-fs { border: 1px solid var(--line); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.af-fs legend { padding: 0 0.5rem; }
.af-opt { display: flex; align-items: flex-start; gap: 0.55rem; color: var(--muted); font-size: 0.88rem; line-height: 1.45; cursor: pointer; }
.af-opt input { margin-top: 0.2rem; accent-color: var(--acid); flex-shrink: 0; }
.appeal-submit {
  align-self: flex-start;
  background: var(--acid); color: #fff; border: none;
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 0.85rem 1.8rem; cursor: pointer;
  transition: opacity .2s ease;
}
.appeal-submit:hover { opacity: 0.9; }
.appeal-verdict h2 { font-weight: 900; font-size: clamp(1.4rem,4vw,2rem); color: var(--ink); margin: 0 0 1rem; text-transform: uppercase; letter-spacing: -0.02em; }
.appeal-verdict p { margin-bottom: 1rem; }
.appeal-verdict .appeal-ref { margin: 1.2rem 0; }
.appeal-again {
  background: transparent; color: var(--dim); border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.1em;
  padding: 0.6rem 1.2rem; cursor: pointer; margin-top: 0.5rem;
}
.appeal-again:hover { color: var(--ink); border-color: rgba(255,255,255,0.25); }
