/* DIDU coop — immersive booth (PMill lounge patterns, pigeon lime) */

.coop-immersive {
  overflow: hidden;
  height: 100dvh;
}

.coop-immersive .page.coop-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}

.coop-atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 380px at 50% -8%, rgba(200, 250, 44, 0.14), transparent 58%),
    radial-gradient(700px 420px at 8% 100%, rgba(200, 250, 44, 0.06), transparent 55%),
    radial-gradient(600px 360px at 92% 20%, rgba(255, 255, 255, 0.04), transparent 50%),
    #08080a;
}

.coop-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 40%, rgba(0, 0, 0, 0.35));
}

.coop-immersive .site-chrome {
  flex-shrink: 0;
  z-index: 6;
}

.coop-site-header {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.coop-site-header .nav-build.is-active {
  color: var(--accent);
  border-color: rgba(200, 250, 44, 0.45);
}

.coop-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0a0a0c;
  background: linear-gradient(180deg, #e8ff9a, var(--accent));
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 0 18px rgba(200, 250, 44, 0.35);
}

.coop-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #052e16;
  animation: coopPulse 1.5s ease-out infinite;
}

@keyframes coopPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(10, 10, 12, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(10, 10, 12, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(10, 10, 12, 0);
  }
}

.coop-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
}

.coop-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(200, 250, 44, 0.18);
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.92), rgba(8, 8, 10, 0.55));
  backdrop-filter: blur(12px);
}

.coop-kicker {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.coop-title {
  margin: 0.15rem 0 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.coop-lead {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.coop-lead strong {
  color: var(--accent);
  font-weight: 800;
}

.coop-presence-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(200, 250, 44, 0.28);
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.coop-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(200, 250, 44, 0.65);
}

.coop-chat-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.coop-messages-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 250, 44, 0.35) transparent;
}

.coop-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 44rem;
  margin-inline: auto;
  width: 100%;
}

.coop-day {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted);
  padding: 8px 0 4px;
}

.coop-day span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.coop-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.coop-row.is-new {
  animation: coopIn 0.22s ease-out;
}

.coop-row.is-mine {
  flex-direction: row-reverse;
}

@keyframes coopIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.coop-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #0a0a0c;
  border: 2px solid rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
}

.coop-bubble-wrap {
  max-width: min(88%, 22rem);
  min-width: 0;
}

.coop-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 4px;
}

.coop-row.is-mine .coop-meta {
  flex-direction: row-reverse;
}

.coop-who {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: lowercase;
}

.coop-time {
  font-size: 0.62rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.coop-bubble {
  padding: 10px 13px 11px;
  border-radius: 18px 18px 18px 6px;
  background: linear-gradient(180deg, rgba(28, 28, 32, 0.95), rgba(14, 14, 18, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.coop-row.is-mine .coop-bubble {
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(180deg, rgba(200, 250, 44, 0.22), rgba(120, 160, 20, 0.12));
  border-color: rgba(200, 250, 44, 0.35);
}

.coop-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.48;
  word-break: break-word;
  white-space: pre-wrap;
}

.coop-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 0 2px;
}

.coop-row.is-mine .coop-reactions {
  justify-content: flex-end;
}

.coop-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
}

.coop-react-btn.is-mine {
  border-color: rgba(200, 250, 44, 0.45);
  background: rgba(200, 250, 44, 0.12);
}

.coop-react-add {
  opacity: 0.85;
  padding: 3px 8px;
  font-weight: 800;
}

.coop-react-picker {
  position: fixed;
  z-index: 10002;
  min-width: 220px;
  max-width: min(92vw, 320px);
  padding: 10px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(200, 250, 44, 0.35);
  background: rgba(12, 12, 15, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

.coop-picker-label {
  margin: 0 0 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.coop-picker-label:not(:first-child) {
  margin-top: 10px;
}

.coop-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.coop-picker-emoji {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.coop-picker-emoji:hover,
.coop-picker-emoji:focus-visible {
  border-color: rgba(200, 250, 44, 0.5);
  background: rgba(200, 250, 44, 0.12);
  outline: none;
}

.coop-empty,
.coop-loading {
  max-width: 28rem;
  margin: 2rem auto;
  text-align: center;
  padding: 1.5rem 1.25rem;
  border-radius: 18px;
  border: 1px dashed rgba(200, 250, 44, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.coop-empty strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.coop-load-more {
  display: block;
  margin: 0 auto 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.coop-jump-latest {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(200, 250, 44, 0.4);
  background: rgba(8, 8, 10, 0.88);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.coop-dock {
  flex-shrink: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(200, 250, 44, 0.16);
  background: linear-gradient(0deg, rgba(8, 8, 10, 0.98), rgba(8, 8, 10, 0.88));
  backdrop-filter: blur(16px);
}

.coop-gate {
  text-align: center;
  padding: 0.35rem 0;
}

.coop-gate-line {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.coop-connect-btn {
  width: 100%;
  max-width: 20rem;
  margin-inline: auto;
}

.coop-compose {
  max-width: 44rem;
  margin: 0 auto;
  width: 100%;
}

.coop-compose-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}

.coop-you {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.coop-name-edit {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}

.coop-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.coop-input-wrap {
  flex: 1;
  display: block;
}

.coop-input {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  font-family: inherit;
}

.coop-input:focus {
  outline: none;
  border-color: rgba(200, 250, 44, 0.45);
  box-shadow: 0 0 0 3px rgba(200, 250, 44, 0.12);
}

.coop-send {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #e8ff9a, var(--accent));
  color: #0a0a0c;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(200, 250, 44, 0.25);
}

.coop-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.coop-compose-hint {
  margin: 6px 4px 0;
  font-size: 0.65rem;
  color: var(--muted);
}

.coop-name-dialog {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0;
  background: #121215;
  color: var(--ink);
  max-width: calc(100vw - 2rem);
}

.coop-name-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.coop-name-form {
  padding: 1.25rem;
}

.coop-name-title {
  margin: 0;
  font-size: 1.1rem;
}

.coop-name-sub {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.coop-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.coop-name-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 768px) {
  .coop-topbar,
  .coop-messages-viewport,
  .coop-dock {
    padding-left: max(1rem, calc((100% - 44rem) / 2));
    padding-right: max(1rem, calc((100% - 44rem) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .coop-row,
  .coop-live-dot {
    animation: none;
  }
}
