*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #ec1187 0%, #f14a5b 45%, #ff8d10 100%);
  background-attachment: fixed;
  color: #000;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.wrap { max-width: 640px; min-height: 100vh; margin: 0 auto; padding: 82px 16px 24px; display: flex; flex-direction: column; }
.wrap.wide { max-width: 640px; padding-top: 40px; gap: 16px; }
.card { display: flex; flex-direction: column; gap: 14px; }

/* ---- message bubble ---- */
.bubble { border-radius: 24px; overflow: hidden; }
.head { display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar.big { width: 84px; height: 84px; margin: 0 auto; border: 4px solid #fff; }
.name { font-size: 14px; font-weight: 400; }
.prompt { font-size: 14px; font-weight: 700; }
.light { color: #fff; }

.field { position: relative; background: rgba(255,255,255,.4); }
textarea {
  display: block; width: 100%; height: 143px; resize: vertical; border: 0; outline: 0;
  padding: 18px 24px 44px; font: inherit; font-size: 18px; font-weight: 700;
  background: transparent; color: #000;
}
textarea::placeholder { color: rgba(0,0,0,.25); }
.dice {
  position: absolute; right: 16px; bottom: 16px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.45); font-size: 16px; cursor: pointer;
}
.dice.roll { animation: roll .45s ease; }
@keyframes roll { to { transform: rotate(360deg) scale(1.1); } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.anon { margin: 0; text-align: center; color: #fff; font-size: 14px; }
.error { margin: 0; text-align: center; color: #fff; background: rgba(0,0,0,.35); padding: 10px 14px; border-radius: 14px; font-weight: 700; }

.send, .cta {
  display: block; width: 100%; padding: 18px; border: 0; border-radius: 999px;
  background: #000; color: #fff; font: inherit; font-size: 18px; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, opacity .12s;
}
.send:active, .cta:active { transform: scale(.97); }
.send:disabled { opacity: .6; }

.sent { background: #fff; border-radius: 24px; padding: 36px 24px; text-align: center; }
.sent h1 { margin: 0; font-size: 28px; }
.sent p { margin: 0; color: #555; font-weight: 600; }
.check { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: #f14a5b; color: #fff; font-size: 34px; font-weight: 800; display: grid; place-items: center; }

/* ---- bottom block pinned low on the page ---- */
.bottom { margin-top: auto; padding-top: 40px; text-align: center; color: #fff; }
.taps { font-weight: 700; font-size: 16px; margin: 0 0 12px; }
.cta { padding: 20px; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03) rotate(-1deg); } }
.brand { margin: 16px 0 0; font-weight: 700; font-size: 12px; color: rgba(255,255,255,.75); }

/* ---- Inbox ---- */
.login { background: #fff; border-radius: 24px; padding: 32px 24px; text-align: center; margin-top: 40px; }
.login h1 { margin: 0; }
.input { width: 100%; padding: 16px 18px; border-radius: 16px; border: 2px solid #eee; font: inherit; font-size: 16px; outline: 0; }
.input:focus { border-color: #f14a5b; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.inbox-head .head { padding: 0; background: none; }
.actions { display: flex; gap: 8px; }
.actions form, .msg-actions form { margin: 0; }
.chip { border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.9); cursor: pointer; }
.chip.dark { background: #000; color: #fff; }
.chip.danger { background: #fee2e2; color: #b91c1c; }
.empty { background: #fff; border-radius: 20px; padding: 28px; text-align: center; font-weight: 700; color: #555; }
.msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { background: #fff; border-radius: 20px; padding: 16px 18px; }
.msg.unread { outline: 3px solid #000; }
.msg-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; }
.msg.unread .msg-label { color: #ec1187; }
.msg-body { margin: 10px 0 12px; font-size: 18px; font-weight: 700; line-height: 1.35; word-wrap: break-word; }
.msg-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- login / register gate on the send page ---- */
.bubble.auth { background: #fff; }
.auth-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.tabs { display: flex; gap: 8px; background: #f1f1f1; border-radius: 999px; padding: 4px; }
.tab { flex: 1; border: 0; border-radius: 999px; padding: 10px; font: inherit; font-weight: 700; font-size: 14px; background: transparent; color: #666; cursor: pointer; }
.tab.on { background: #fff; color: #000; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-body .input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid #eee; font: inherit; font-size: 16px; outline: 0; }
.auth-body .input:focus { border-color: #f14a5b; }
.auth-body .send { padding: 15px; }
.auth-body .error { color: #fff; background: rgba(0,0,0,.4); }

.whoami { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; color: #fff; font-size: 14px; }
.whoami strong { font-weight: 700; }
.linkbtn { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
