:root {
  --bg: #000;
  --ink: #fff;
  --ink-weak: #bbb;
  --panel: #0b0b0b;
  --panel-2: #111;
  --stroke: #333;
  --fade: 0.7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: monospace;
  height: 100%;
  overflow: hidden;
}

/* Canvas backdrop */
#void {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Emoji launcher at bottom (always visible) */
#tag-trigger {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

#tag-trigger button {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  opacity: var(--fade);
  transition: opacity 0.25s ease, transform 0.1s ease, background 0.25s ease;
  animation: pulse 2.8s ease-in-out infinite;
}

#tag-trigger button:hover,
#tag-trigger button.active {
  opacity: 1;
  background: #1a1a1a;
  transform: translateY(-1px);
}

@keyframes pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 0.95; }
}

/* When form opens, lift the emoji bar so they don't overlap */
body.form-open #tag-trigger {
  bottom: 72px;
}

/* Composer form (hidden until an emoji is clicked) */
#form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none; /* toggled by JS */
  gap: 8px;
  padding: 12px;
  background: var(--panel);
  border-top: 1px solid var(--stroke);
  z-index: 40;
  align-items: center;
  flex-wrap: wrap;
}

#input {
  flex: 1;
  min-width: 0;
  background: #111;
  color: var(--ink);
  border: 1px solid var(--stroke);
  padding: 12px;
  font-size: 16px; /* Prevent mobile zoom */
  border-radius: 8px;
  resize: vertical;
  min-height: 60px;
  max-height: 160px;
  line-height: 1.4;
  font-family: monospace;
}

#files {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  color: var(--ink);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

button[type="submit"] {
  background: #444;
  color: var(--ink);
  border: 1px solid var(--stroke);
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
}

/* Preview modal for attachments */
#preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none; /* toggled */
  align-items: center;
  justify-content: center;
  z-index: 60;
}

#preview {
  background: #0f0f0f;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  width: min(520px, 92vw);
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#preview h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--ink-weak);
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #222;
}
.preview-item:last-child { border-bottom: 0; }

.preview-name {
  color: var(--ink);
  word-break: break-all;
  font-size: 13px;
}

.preview-meta {
  color: var(--ink-weak);
  font-size: 12px;
}

.preview-actions a {
  color: #9ad;
  text-decoration: underline;
  font-size: 13px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  #tag-trigger {
    gap: 6px;
    padding: 6px;
  }
  #tag-trigger button {
    font-size: 20px;
    padding: 6px 8px;
  }
  #form {
    padding: 10px;
    gap: 6px;
  }
}

