*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { background: #000; font-family: system-ui, sans-serif; color: #fff; }

/* Canvas */
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Title */
.title {
  position: fixed;
  top: 20px;
  left: 20px;
  font-weight: 300;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: titleGlow 3s ease-in-out infinite alternate;
  z-index: 5;
  pointer-events: none;
}

/* Midnight reset info */
.midnight-info {
  position: fixed;
  top: 20px;
  right: 20px;
  font-weight: 300;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  z-index: 5;
  pointer-events: none;
  text-align: right;
}

/* Subscribe button (top-right) */
.subscribe-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 400;
  z-index: 10;
}

.subscribe-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* Manage subscription button (gear icon) */
.manage-subscription-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  z-index: 10;
}

.manage-subscription-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* My Echo button */
.my-echo-button {
  position: fixed;
  top: 20px;
  right: 70px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 400;
  z-index: 10;
}

.my-echo-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* FAQ button (question mark) */
.faq-button {
  position: fixed;
  top: 20px;
  right: 120px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  font-weight: 300;
  z-index: 10;
}

.faq-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* Back to Public button */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 400;
  z-index: 10;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* Echo notice */
.echo-notice {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 300;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  z-index: 5;
  pointer-events: none;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
  to { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 30px rgba(255, 255, 255, 0.3); }
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 10;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tooltip.visible {
  opacity: 1;
}

/* Input area */
.input-area {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

/* Textarea */
.whisper-input {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  outline: none;
  height: 40px;
  resize: none;
  font-family: system-ui, sans-serif;
  width: 100%;
}

.whisper-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Input row with counter and button */
.input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Character counter */
.char-counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.char-counter.error {
  color: rgba(255, 100, 100, 0.8);
}

/* Subscriber badge */
.subscriber-badge {
  font-size: 12px;
  color: #d4a373;
  font-weight: 300;
  margin-left: 8px;
}

/* Token display */
.token-display {
  font-size: 12px;
  color: rgba(255, 215, 150, 0.8);
  margin-left: 8px;
}

/* Buy token button */
.buy-token-button {
  background: rgba(255, 215, 150, 0.15);
  border: 1px solid rgba(255, 215, 150, 0.3);
  color: rgba(255, 215, 150, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  margin-left: 4px;
}

.buy-token-button:hover {
  background: rgba(255, 215, 150, 0.25);
  border-color: rgba(255, 215, 150, 0.5);
}

/* Cast button */
.cast-button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.cast-button:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.cast-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cast-button:disabled:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Success message */
.success-message {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  opacity: 1;
  animation: fadeOut 2s forwards;
  z-index: 5;
  pointer-events: none;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* Error message */
.error-message {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 150, 150, 0.9);
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  animation: errorFadeOut 3s forwards;
}

/* Void error message */
.void-error {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

@keyframes errorFadeOut {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Info pages (FAQ, Terms, Privacy) */
.info-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 80px 20px 40px;
  overflow-y: auto;
  z-index: 100;
  color: rgba(255, 255, 255, 0.9);
}

.info-page h1 {
  font-weight: 300;
  font-size: 28px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.info-page h2 {
  font-weight: 400;
  font-size: 18px;
  margin-top: 30px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.95);
}

.info-page p {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.8);
}

.info-page ul {
  margin-left: 20px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.8);
}

.info-page li {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.info-page a {
  color: rgba(255, 215, 150, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.info-page a:hover {
  color: rgba(255, 215, 150, 1);
  text-decoration: underline;
}

.info-page .info-links {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-page .info-links a {
  margin-right: 20px;
  font-size: 14px;
}

/* Close button for info pages */
.close-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 24px;
  font-weight: 300;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 1);
}

/* Loading spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile responsive */
@media (max-width: 600px) {
  .title {
    top: 12px;
    left: 12px;
    font-size: 14px;
  }

  .midnight-info {
    top: 12px;
    right: 12px;
    font-size: 10px;
  }

  .subscribe-button,
  .manage-subscription-button,
  .my-echo-button,
  .faq-button {
    top: 12px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .subscribe-button {
    right: 12px;
  }

  .manage-subscription-button {
    right: 12px;
  }

  .my-echo-button {
    right: 60px;
  }

  .faq-button {
    right: 110px;
  }

  .back-button {
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .echo-notice {
    top: 12px;
    font-size: 11px;
  }

  .input-area {
    bottom: 12px;
    width: 95%;
    max-width: none;
    padding: 10px;
  }

  .whisper-input {
    font-size: 16px;
    height: 36px;
  }

  .cast-button {
    padding: 5px 14px;
    font-size: 13px;
  }

  .tooltip {
    max-width: 240px;
    font-size: 13px;
  }
}
