:root {
  --bg: #0a0612;
  --card: rgba(18, 12, 32, 0.85);
  --stroke: rgba(168, 85, 247, 0.28);
  --text: #f4edff;
  --muted: rgba(244, 237, 255, 0.55);
  --accent: #c084fc;
  --accent-2: #22d3ee;
  --danger: #fb7185;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  width: 420px;
  height: 420px;
  background: #7c3aed;
  top: -120px;
  right: -80px;
}

.glow-b {
  width: 360px;
  height: 360px;
  background: #0891b2;
  bottom: -100px;
  left: -60px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.logo {
  border-radius: 14px;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.hero-text h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, #e9d5ff, #a78bfa 40%, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.tagline {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-2);
}

.sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52ch;
}

.mono {
  font-family: var(--mono);
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  backdrop-filter: blur(12px);
}

.card-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.room-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.room-tab {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.room-tab:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(168, 85, 247, 0.35);
}

.room-tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(147, 51, 234, 0.18);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.15);
}

.room-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.room-label {
  color: var(--accent-2);
  font-weight: 600;
}

.gate-status {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 2.8em;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #042f2e;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn.sm {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.fineprint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(244, 237, 255, 0.38);
}

.hidden {
  display: none !important;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.online-count {
  margin: 0 0 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-2);
}

.you-are {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.you-are-label {
  flex: 0 0 auto;
}

.display-name-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.wallet-verify {
  margin: 0;
  color: var(--muted);
}

.wallet-verify .mono {
  color: rgba(244, 237, 255, 0.72);
}

.name-modal-lead {
  margin: 0 0 12px;
}

.wallet-inline {
  word-break: break-all;
  font-weight: 500;
}

.chat-log {
  height: min(420px, 52vh);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  scroll-behavior: smooth;
}

.msg {
  line-height: 1.45;
}

.msg:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.msg-system {
  color: var(--muted);
  font-style: italic;
  font-size: 0.82rem;
}

.msg-chat {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 6px;
  margin: 0 -6px;
  transition: background 0.12s ease;
}

.msg-chat:hover {
  background: rgba(255, 255, 255, 0.05);
}

.msg-chat:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.msg-reply {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 4px 0 4px 10px;
  border-left: 3px solid rgba(192, 132, 252, 0.45);
  word-break: break-word;
  line-height: 1.35;
}

.msg-chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg-body-wrap {
  flex: 1;
  min-width: 0;
}

.msg-tip-btn {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 0.72rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.msg-chat .who {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--accent-2);
  flex: 0 0 auto;
  max-width: 10rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-chat .body {
  color: var(--text);
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
}

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(147, 51, 234, 0.12);
  font-size: 0.82rem;
  color: var(--muted);
}

.reply-bar-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}

.chat-form input::placeholder {
  color: rgba(244, 237, 255, 0.35);
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2);
}

.emoji-btn {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  padding-left: 12px;
  padding-right: 12px;
}

.emoji-picker-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  max-width: min(100vw - 48px, 368px);
}

.emoji-picker-pop emoji-picker {
  --border-radius: 10px;
  width: min(100vw - 48px, 352px);
  height: min(360px, 42vh);
}

.gif-btn {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding-left: 10px;
  padding-right: 10px;
}

.gif-picker-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 45;
  width: min(100vw - 48px, 392px);
  max-height: min(52vh, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.gif-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}

.gif-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2);
}

.gif-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  overflow-y: auto;
  max-height: min(38vh, 320px);
}

.gif-thumb {
  border: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  aspect-ratio: 1;
}

.gif-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gif-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gif-picker-empty {
  margin: 4px 0 0;
}

.msg-chat-gif .msg-body-wrap {
  flex: 1;
  min-width: 0;
}

.msg-gif {
  display: block;
  max-width: min(100%, 280px);
  max-height: 220px;
  border-radius: 10px;
  margin-top: 2px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: min(90vh, 560px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.tip-to {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.tip-to strong {
  color: var(--text);
  font-weight: 500;
}

.tip-recipient-name {
  font-family: var(--font);
  word-break: break-word;
  font-weight: 600;
}

.tip-field {
  margin-bottom: 14px;
}

.tip-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.tip-select,
.tip-input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.92rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.tip-select:focus,
.tip-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2);
}

.tip-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tip-preset {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.tip-preset:hover {
  color: var(--text);
  border-color: rgba(168, 85, 247, 0.4);
}

.tip-status {
  margin: 0 0 8px;
  color: var(--muted);
}

.tip-error {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--danger);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.tx-details-modal {
  z-index: 110;
}

.tx-details-card .modal-title {
  margin-bottom: 8px;
}

.tx-details-lead {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.tx-details-signature {
  margin: 0 0 14px;
  padding: 12px 14px;
  max-height: 120px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.tx-details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.tx-details-solscan-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tx-details-close-row {
  margin-top: 4px;
  justify-content: stretch;
}

.tx-details-close-row .btn {
  width: 100%;
  justify-content: center;
}

.tip-disclaimer {
  margin: 14px 0 0;
}

.msg-tip {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 -6px;
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.22);
}

.msg-tip-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg-tip-icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1.35;
}

.msg-tip-main {
  flex: 1;
  min-width: 0;
}

.msg-tip-line {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.msg-tip-who {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--accent-2);
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-tip-mid {
  color: var(--muted);
}

.msg-tip-amount {
  font-weight: 700;
  color: var(--accent);
}

.msg-tip-links {
  margin-top: 8px;
}

.msg-tip-solscan {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msg-tip-solscan:hover {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
