/* ============================================
   SHINOBU — SHINOBI DESIGN SYSTEM
   Dark (bg) / Light (surface) / Blood Moon (accent)
   ============================================ */

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

:root {
  --bg: #0A0A0A;
  --surface: #F2F0EC;
  --pink: #8B0000;
  --pink-dark: #5C0000;
  --gray: #8A8A85;
  --border: 3px solid var(--surface);
  --shadow: 6px 6px 0 var(--pink);
  --shadow-sm: 4px 4px 0 var(--pink);
  --shadow-dark: 6px 6px 0 var(--surface);
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  font-family: 'Space Grotesk', sans-serif;
  background: transparent;
  color: var(--surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3 {
  font-family: 'Archivo Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(3rem, 10vw, 6rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: 0.85rem; letter-spacing: 0.15em; color: var(--pink-dark); }

.wordmark {
  text-align: center;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.wordmark::after {
  content: 'SHINOBU';
  position: absolute;
  left: 5px;
  top: 5px;
  color: var(--pink);
  z-index: -1;
}

.tagline {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(0.9rem, 2.2vw, 1.2rem);
  text-align: center;
  color: var(--surface);
  letter-spacing: 0.45em;
  margin-bottom: 4rem;
  text-transform: none;
  text-shadow:
    0 0 8px rgba(196, 30, 58, 0.8),
    0 0 20px rgba(196, 30, 58, 0.6),
    0 0 40px rgba(196, 30, 58, 0.4),
    0 0 80px rgba(196, 30, 58, 0.2);
}

/* ============================================
   BACKGROUND VIDEO
   ============================================ */
/* ============================================
   BACKGROUND VIDEO
   ============================================ */
#bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0A0A0A url('bg-desktop.jpg') no-repeat center center/cover;
  z-index: 0;
}

@media (max-width: 767px) {
  #bg-container {
    background-image: url('bg-mobile.jpg');
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #bg-container {
    background-image: url('bg-tablet.jpg');
  }
}

.moon-glow {
  position: absolute;
  top: 15%;
  left: 43%;
  width: 15vw;
  height: 15vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, rgba(255, 0, 0, 0) 70%);
  animation: pulse 4s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: transparent;
}

.screen > * {
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

#screen-home,
#screen-about,
#screen-left-menu,
#screen-room-type,
#screen-join-type,
#screen-create-live,
#screen-create-group,
#screen-join-live,
#screen-join-group,
#screen-create-mailbox,
#screen-join-mailbox {
  padding: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

#screen-home {
  overflow: hidden;
}

#screen-about {
  justify-content: flex-start;
  padding-top: 3rem;
}

@media (min-width: 768px) {
  #screen-home,
  #screen-about,
  #screen-left-menu,
  #screen-room-type,
  #screen-join-type,
  #screen-create-live,
  #screen-create-group,
  #screen-join-live,
  #screen-join-group,
  #screen-create-mailbox,
  #screen-join-mailbox {
    padding: 32px 40px;
  }
}

@media (min-width: 1024px) {
  #screen-home,
  #screen-about,
  #screen-left-menu,
  #screen-room-type,
  #screen-join-type,
  #screen-create-live,
  #screen-create-group,
  #screen-join-live,
  #screen-join-group,
  #screen-create-mailbox,
  #screen-join-mailbox {
    padding: 40px 48px;
  }
}

.container {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#screen-home .container,
#screen-left-menu .container,
#screen-create-live .container,
#screen-join-live .container,
#screen-create-mailbox .container,
#screen-join-mailbox .container {
  max-width: 480px;
}

#screen-about .container {
  max-width: 640px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: block;
  width: 100%;
  padding: 1.25rem 1.75rem;
  background: var(--surface);
  color: var(--bg);
  border: 3px solid var(--surface);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
  text-align: center;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn:active:not(:disabled) {
  transform: translate(6px, 6px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--surface);
  border-color: var(--surface);
}

.btn-send {
  width: auto;
  padding: 0.85rem 1.5rem;
  background: var(--pink);
  color: var(--surface);
  border: 2px solid var(--surface);
  border-radius: 0;
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-send:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-leave {
  width: 100%;
  background: transparent;
  color: var(--pink);
  border: 2px solid var(--pink);
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: none;
  transition: background 100ms steps(2), color 100ms steps(2);
}

.btn-leave:hover {
  background: var(--pink);
  color: var(--surface);
}

.btn-leave:active {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-back {
  align-self: flex-start;
  background: none;
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--surface);
  cursor: pointer;
  margin-bottom: 2.5rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 100ms steps(2);
}

.btn-back:hover {
  border-bottom-color: var(--pink);
}

.btn-help {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--bg);
  border: 2px solid var(--pink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--surface);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--pink), 0 0 12px rgba(139, 0, 0, 0.4);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.btn-help:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

/* ============================================
   HELP BUTTON
   ============================================ */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 380px;
}

/* ============================================
   MODE TAGS
   ============================================ */
.mode-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--pink);
  color: var(--surface);
  padding: 0.2rem 0.5rem;
  margin-left: 0.75rem;
  vertical-align: middle;
  letter-spacing: 0.08em;
}

.tag-live, .tag-async {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65em;
  font-weight: 700;
  padding: 0.15em 0.5em;
  vertical-align: middle;
}

.tag-live {
  background: var(--pink);
  color: var(--surface);
}

.tag-async {
  background: var(--surface);
  color: var(--pink);
}

/* ============================================
   CODE INPUT — "TICKET STUB" EFFECT
   ============================================ */
.input-group {
  width: 100%;
  max-width: 380px;
  position: relative;
  margin-bottom: 2rem;
}

.code-input {
  width: 100%;
  padding: 1.5rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: var(--bg);
  border: 4px solid var(--surface);
  color: var(--surface);
  text-align: center;
  outline: none;
  caret-color: var(--pink);
  transition: border-color 100ms steps(2);
}

.code-input::placeholder {
  color: var(--gray);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}

.code-input:focus {
  border-color: var(--pink);
}

.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg) scale(0);
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.75rem;
  color: var(--pink);
  border: 5px solid var(--pink);
  padding: 0.3rem 1.2rem;
  pointer-events: none;
  opacity: 0;
  transition: transform 120ms steps(3), opacity 80ms steps(2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stamp.visible {
  transform: translate(-50%, -50%) rotate(-12deg) scale(1);
  opacity: 1;
}

/* ============================================
   INSTRUCTION TEXT
   ============================================ */
.instruction {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--gray);
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================
   ABOUT SCREEN
   ============================================ */
.about-text {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  text-align: center;
  max-width: 380px;
}

.about-section {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  border: 2px solid var(--surface);
  margin-bottom: 1.25rem;
  position: relative;
  background: rgba(10, 10, 10, 0.9);
}

.about-section::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 100%;
  height: 100%;
  background: var(--pink);
  z-index: -1;
  opacity: 0.3;
}

.about-section h3 {
  margin-bottom: 0.5rem;
  color: var(--pink);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

.about-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--surface);
}

.origin-story {
  width: 100%;
  max-width: 420px;
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  border: 2px solid var(--pink);
  position: relative;
  background: rgba(139, 0, 0, 0.08);
}

.origin-story::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 100%;
  height: 100%;
  background: var(--pink);
  z-index: -1;
  opacity: 0.15;
}

.origin-story h3 {
  margin-bottom: 1rem;
  color: var(--pink);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

.origin-story p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--gray);
  margin-bottom: 1rem;
  font-family: 'Shippori Mincho', serif;
}

.origin-story p:last-child {
  margin-bottom: 0;
  color: var(--surface);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}

.origin-story .story-divider {
  width: 60px;
  height: 2px;
  background: var(--pink);
  margin: 1.5rem auto;
  opacity: 0.5;
}

/* ============================================
   ROOM VIEW — FULL LAYOUT
   ============================================ */
.room-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.room-header {
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(138, 138, 133, 0.2);
  flex-shrink: 0;
  gap: 1rem;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gray);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.code-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--pink);
  color: var(--surface);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

/* ============================================
   PRESENCE
   ============================================ */
.presence-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.presence-dot {
  width: 10px;
  height: 10px;
  background: var(--gray);
  border: 2px solid var(--surface);
}

.presence-dot.active {
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}

.presence-dot.away {
  background: var(--gray);
}

.presence-dot.disconnected {
  background: transparent;
}

.presence-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ============================================
   EXPIRY
   ============================================ */
.expiry-bar, .expiry-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 1000px;
  padding: 0.5rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(138, 138, 133, 0.15);
}

.expiry-time {
  color: var(--gray);
  font-weight: 700;
}

.capture-warning {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--pink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--pink);
  margin-left: auto;
}

/* ============================================
   MESSAGES — PREMIUM CHAT STYLE
   ============================================ */
.messages-container {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 1000px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.message {
  width: 50%;
  max-width: 420px;
  min-width: 200px;
  padding: 20px 22px;
  border-radius: 0;
  border: 2px solid var(--surface);
  position: relative;
  word-wrap: break-word;
  animation: msgIn 250ms ease-out;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.message:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--pink);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.sent {
  align-self: flex-end;
  background: var(--surface);
  color: var(--bg);
  border: 2px solid var(--surface);
  box-shadow: 4px 4px 0 var(--pink);
}

.message.sent:hover {
  box-shadow: 6px 6px 0 var(--pink);
}

.message.received {
  align-self: flex-start;
  background: #1A1A1A;
  color: var(--surface);
  border: 2px solid var(--surface);
  box-shadow: 4px 4px 0 var(--gray);
}

.message.received:hover {
  box-shadow: 6px 6px 0 var(--gray);
}

.message-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gray);
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.message.sent .message-meta {
  color: rgba(10, 10, 10, 0.5);
}

.message.received .message-meta {
  color: var(--gray);
}

.read-indicator {
  color: var(--pink);
  font-weight: 700;
}

.message-text {
  font-size: 1rem;
  line-height: 1.6;
}

.message-system {
  width: 100%;
  text-align: center;
  padding: 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 1px solid rgba(138, 138, 133, 0.15);
  border-bottom: 1px solid rgba(138, 138, 133, 0.15);
}

/* ============================================
   INPUT AREA — HORIZONTAL ON DESKTOP
   ============================================ */
.input-area {
  flex-shrink: 0;
  width: 100%;
  max-width: 1000px;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(138, 138, 133, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  background: #1A1A1A;
  border: 2px solid var(--surface);
  border-radius: 0;
  color: var(--surface);
  resize: none;
  outline: none;
  transition: border-color 200ms ease;
}

.message-input:focus {
  border-color: var(--pink);
}

.message-input::placeholder {
  color: var(--gray);
  font-size: 0.9rem;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.input-row .message-input {
  flex: 1;
}

/* ============================================
   CHECKBOX
   ============================================ */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.1em;
  cursor: pointer;
  text-transform: uppercase;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
}

/* ============================================
   ROOM ACTIONS
   ============================================ */
.room-actions {
  flex-shrink: 0;
  width: 100%;
  max-width: 1000px;
  padding: 0.75rem 2rem 1.25rem;
}

/* ============================================
   PANIC OVERLAY
   ============================================ */
.panic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.panic-overlay.hidden {
  display: none;
}

.panic-content {
  background: var(--bg);
  border: 4px solid var(--surface);
  padding: 2.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
}

.panic-content::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--pink-dark);
  z-index: -1;
}

.panic-content h2 {
  color: var(--pink-dark);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.panic-content p {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.panic-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: var(--gray);
}

/* ============================================
   RESPONSIVE — TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
  .messages-container {
    padding: 36px 40px;
    gap: 26px;
  }

  .message {
    width: 50%;
    max-width: 420px;
  }

  .input-row {
    flex-direction: row;
  }

  .input-area {
    padding: 1rem 2rem;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .messages-container {
    padding: 40px 48px;
    gap: 28px;
  }

  .message {
    width: 45%;
    max-width: 480px;
    padding: 22px 24px;
  }

  .message-text {
    font-size: 1.05rem;
  }

  .input-area {
    padding: 1rem 2.5rem;
  }
}

/* ============================================
   RESPONSIVE — LARGE DESKTOP (1280px+)
   ============================================ */
@media (min-width: 1280px) {
  .messages-container {
    padding: 48px 56px;
  }

  .message {
    max-width: 520px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE (480px-)
   ============================================ */
@media (max-width: 480px) {
  .room-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .messages-container {
    padding: 20px 12px;
    gap: 20px;
  }

  .message {
    width: 85%;
    max-width: 320px;
    padding: 18px 20px;
  }

  .input-area {
    padding: 0.75rem 12px;
  }

  .room-actions {
    padding: 0.5rem 12px 0.75rem;
  }

  .input-row {
    flex-direction: row;
  }

  .input-row .btn-send {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .btn-attach {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .input-row .message-input {
    flex: 1;
    min-width: 0;
  }
}

.file-input-hidden {
  display: none;
}

.btn-attach {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border: 2px solid var(--surface);
  color: var(--surface);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 100ms steps(2);
}

.btn-attach:hover {
  border-color: var(--pink);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.upload-preview:empty {
  display: none;
}

.upload-preview-item {
  position: relative;
  border: 2px solid var(--surface);
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--surface);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
}

.upload-preview-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--surface);
}

.upload-preview-remove {
  background: none;
  border: none;
  color: var(--pink);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(242, 240, 236, 0.15);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--pink);
  transition: width 200ms ease;
}

.upload-progress-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--pink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.message-file {
  margin-top: 2px;
}

.file-loading {
  padding: 20px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--gray);
  animation: filePulse 1.5s ease-in-out infinite;
}

@keyframes filePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.file-error {
  padding: 16px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink);
  border: 2px solid var(--pink);
}

.file-image-wrapper {
  max-width: 320px;
}

.file-image {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--surface);
  cursor: pointer;
  transition: opacity 150ms;
}

.message.sent .file-image {
  border-color: var(--bg);
}

.file-image:hover {
  opacity: 0.85;
}

.file-download-btn {
  display: block;
  margin-top: 8px;
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-decoration: none;
  color: var(--surface);
  background: var(--pink);
  border: 2px solid var(--surface);
  cursor: pointer;
  transition: background 100ms steps(2);
}

.file-download-btn:hover {
  background: var(--pink-dark);
}

.file-video-wrapper {
  max-width: 320px;
}

.file-video {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--surface);
  background: #000;
}

.message.sent .file-video {
  border-color: var(--bg);
}

.file-audio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.file-audio-icon {
  font-size: 1.5rem;
}

.file-audio {
  width: 100%;
  height: 36px;
}

.file-doc-wrapper {
  max-width: 300px;
}

.file-doc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--surface);
  transition: background 150ms;
  cursor: pointer;
}

.message.sent .file-doc-link {
  border-color: var(--bg);
}

.file-doc-link:hover {
  background: rgba(139, 0, 0, 0.12);
}

.file-doc-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.file-doc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-doc-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-doc-size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  opacity: 0.5;
}

.file-doc-download {
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.file-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  opacity: 0.5;
  margin-top: 4px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-item {
  position: relative;
  border: 2px solid var(--surface);
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--surface);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
}

.upload-preview-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--surface);
}

.upload-preview-icon {
  font-size: 1.2rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.upload-preview-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.upload-preview-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.upload-preview-size {
  font-size: 0.6rem;
  opacity: 0.5;
}

.upload-preview-remove {
  background: none;
  border: none;
  color: var(--pink);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}

.upload-preview-remove:hover {
  opacity: 1;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.75rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2000;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
  border: 2px solid;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  background: var(--bg);
  color: var(--pink);
  border-color: var(--pink);
}

.toast-info {
  background: var(--bg);
  color: var(--surface);
  border-color: var(--surface);
}

/* ============================================
   SHARE OVERLAY MODAL
   ============================================ */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.share-content {
  background: var(--bg);
  border: 4px solid var(--surface);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
}

.share-content::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--pink-dark);
  z-index: -1;
}

.share-content h3 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.5rem;
  color: var(--surface);
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
}

.share-section {
  margin-bottom: 1.25rem;
  text-align: left;
}

.share-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gray);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.share-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--bg);
  padding: 0.6rem 1rem;
  letter-spacing: 0.05em;
  word-break: break-all;
  border: 2px solid var(--surface);
}

.share-value.share-key {
  background: var(--pink);
  color: var(--surface);
  border-color: var(--pink);
}

.share-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  background: #1A1A1A;
  color: var(--gray);
  padding: 0.6rem 1rem;
  word-break: break-all;
  border: 1px solid rgba(138, 138, 133, 0.3);
  line-height: 1.5;
}

.share-warning {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--pink);
  background: rgba(139, 0, 0, 0.12);
  border: 1px solid rgba(139, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  text-align: left;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.share-tip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gray);
  margin-top: 1rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.share-actions .btn {
  font-size: 0.85rem;
  padding: 0.9rem 1.25rem;
}

/* ============================================
   KEY PROMPT OVERLAY
   ============================================ */
.key-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.key-prompt-content {
  background: var(--bg);
  border: 4px solid var(--pink);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
}

.key-prompt-content::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--pink-dark);
  z-index: -1;
}

.key-prompt-content h3 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.3rem;
  color: var(--pink);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}

.key-prompt-desc {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.key-prompt-input {
  width: 100%;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #1A1A1A;
  border: 2px solid var(--surface);
  color: var(--surface);
  text-align: center;
  outline: none;
  caret-color: var(--pink);
  margin-bottom: 1.25rem;
}

.key-prompt-input:focus {
  border-color: var(--pink);
}

.key-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.key-prompt-actions .btn {
  font-size: 0.85rem;
  padding: 0.9rem 1.25rem;
}

.key-prompt-warning {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gray);
  margin-top: 1rem;
  letter-spacing: 0.06em;
}

/* ============================================
   SELF-DESTRUCT CONFIRM BUTTON
   ============================================ */
.btn-confirm {
  background: var(--pink) !important;
  color: var(--surface) !important;
  border-color: var(--pink) !important;
  animation: confirmPulse 0.8s ease-in-out infinite alternate;
}

@keyframes confirmPulse {
  from { box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.4); }
  to { box-shadow: 0 0 12px 4px rgba(139, 0, 0, 0.6); }
}

/* ============================================
   SAFETY NUMBER BADGE
   ============================================ */
.safety-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--pink);
  letter-spacing: 0.15em;
  margin-left: auto;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(139, 0, 0, 0.4);
  background: rgba(139, 0, 0, 0.08);
  white-space: nowrap;
}

.safety-number:empty {
  display: none;
}

/* ============================================
   ENCRYPTION BADGE
   ============================================ */
.encryption-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(139, 0, 0, 0.4);
  background: rgba(139, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================
   AUTO-GENERATE CODE BUTTON
   ============================================ */
.btn-generate {
  display: block;
  width: 100%;
  max-width: 380px;
  padding: 0.6rem 1.25rem;
  margin-bottom: 1.5rem;
  background: transparent;
  color: var(--pink);
  border: 2px dashed rgba(139, 0, 0, 0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 100ms steps(2), border-color 100ms steps(2);
}

.btn-generate:hover {
  background: rgba(139, 0, 0, 0.1);
  border-color: var(--pink);
}

.btn-generate:active {
  background: rgba(139, 0, 0, 0.2);
}

/* ============================================
   REPORT ABUSE BUTTON
   ============================================ */
.btn-report {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  background: transparent;
  color: var(--gray);
  border: 1px solid rgba(138, 138, 133, 0.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 100ms steps(2), border-color 100ms steps(2);
}

.btn-report:hover {
  color: var(--pink);
  border-color: var(--pink);
}

/* ============================================
   SECURITY PAGE LINK (ABOUT)
   ============================================ */
.security-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 100ms steps(2), border-color 100ms steps(2);
}

.security-link:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

.insta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1.2rem 0 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 100ms steps(2), border-color 100ms steps(2);
}

.insta-link:hover {
  color: var(--surface);
  border-bottom-color: var(--surface);
}



.github-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink);
  text-decoration: none;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--pink);
  transition: background 200ms, color 200ms;
}

.github-link:hover {
  background: var(--pink);
  color: var(--surface);
}

/* ============================================
   RESPONSIVE — SHARE MODAL MOBILE
   ============================================ */
@media (max-width: 480px) {
  .share-content,
  .key-prompt-content {
    padding: 1.5rem;
  }

  .share-content h3,
  .key-prompt-content h3 {
    font-size: 1.1rem;
  }

  .share-value {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .share-url {
    font-size: 0.6rem;
  }

  .encryption-badge {
    font-size: 0.5rem;
  }

  .safety-number {
    font-size: 0.75rem;
  }

  .btn-generate {
    font-size: 0.7rem;
  }
}

/* ============================================
   GROUP CHAT — MEMBER PANEL
   ============================================ */
.member-toggle {
  background: none;
  border: 1px solid var(--surface);
  color: var(--surface);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: border-color 200ms, color 200ms;
  white-space: nowrap;
}

.member-toggle:hover {
  border-color: var(--pink);
  color: var(--pink);
}

#member-count-badge {
  color: var(--pink);
  font-weight: 700;
}

.member-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  max-width: 80vw;
  height: 100%;
  background: var(--bg);
  border-left: 2px solid var(--surface);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.member-panel.hidden {
  display: none;
}

.member-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(138, 138, 133, 0.2);
  flex-shrink: 0;
}

.member-panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink);
}

.member-panel-close {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem;
}

.member-panel-close:hover {
  color: var(--surface);
}

.member-panel-list {
  flex: 1;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid rgba(138, 138, 133, 0.1);
}

.member-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-name {
  font-size: 0.85rem;
  color: var(--surface);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-you {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--pink);
  border: 1px solid var(--pink);
  padding: 0.1em 0.4em;
  flex-shrink: 0;
}

.member-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-status.active {
  background: #00B894;
}

.member-status.away {
  background: var(--gray);
}

/* ============================================
   GROUP CHAT — MESSAGE NAME BADGES
   ============================================ */
.message-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

