* { box-sizing: border-box; }
html, body { margin: 0; background: #000000; color: #ffffff; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: #ffffff; }
a:hover { color: #d4d4d8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Starfield: three box-shadow layers drifting up at different speeds (stars are drawn by app.js), plus a rare shooting star. */
.sky {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 100%, #07070d, #000000 70%);
}
.stars { position: absolute; left: 0; top: 0; border-radius: 50%; animation: rise linear infinite; }
#stars-far { width: 1px; height: 1px; animation-duration: 180s; }
#stars-mid { width: 1.5px; height: 1.5px; animation-duration: 120s; }
#stars-near { width: 2px; height: 2px; animation-duration: 75s; }
.shooting {
  position: absolute; left: 72%; top: 14%; width: 140px; height: 1px; opacity: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  animation: shoot 14s ease-out 4s infinite;
}
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-1400px); } }
@keyframes shoot {
  0%, 90% { opacity: 0; transform: rotate(-18deg) translateX(0); }
  91% { opacity: 0.75; }
  96%, 100% { opacity: 0; transform: rotate(-18deg) translateX(-460px); }
}
@media (prefers-reduced-motion: reduce) { .stars, .shooting { animation: none; } }

.page {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  padding: 20px clamp(16px, 4vw, 60px);
}
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #ffffff; }
/* The logo: upside-down heart, a small red "evil" on Qwen's baseline. */
.brand-name { display: flex; align-items: baseline; gap: 4px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.brand-name span { font-size: 28px; }
.brand-name .evil { font-size: 11px; letter-spacing: 0; color: #ff4060; }
.links { display: flex; align-items: center; gap: 8px; }
.links a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; font-size: 15px; font-weight: 500;
}
.links a:hover { color: #a1a1aa; }
.links a:focus-visible, #send:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

.main {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  width: 100%; max-width: 840px; margin: 0 auto; padding: 48px 0; gap: 40px;
}
h1 { margin: 0; text-align: center; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.2; font-weight: 600; }

.log {
  /* 12px wider on the right, padded back, so the scrollbar sits just outside the messages instead of on them */
  width: calc(100% + 12px); margin-right: -12px; padding-right: 12px;
  display: flex; flex-direction: column; gap: 22px;
  max-height: 52vh; overflow-y: auto; font-size: 16px; line-height: 1.6;
  overscroll-behavior: contain;
}
.msg-user {
  align-self: flex-end; max-width: 75%; padding: 12px 18px;
  background: #27272a; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-qwen { display: flex; gap: 12px; align-items: flex-start; }
.msg-qwen svg { flex: none; margin-top: 2px; }
.msg-qwen div { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-note { color: #a1a1aa; }

.box {
  position: relative; width: 100%; padding: 18px 20px 66px;
  background: #2c2c30; border-radius: 26px;
}
.box:focus-within { box-shadow: 0 0 0 1px #52525b; }
#q {
  display: block; width: 100%; resize: none; border: 0; background: transparent; color: #ffffff;
  font: inherit; font-size: 16px; line-height: 1.5; max-height: 200px; padding: 2px;
}
/* The placeholder is real text so "evil" can be small and red (a lighter red than the logo's, to stay readable on
   the box grey); it goes as soon as the box has text. The textarea's placeholder is a space so :placeholder-shown works. */
.hint { position: absolute; left: 22px; top: 20px; pointer-events: none; color: #9a9aa0; font-size: 16px; line-height: 1.5; }
.hint .evil { font-size: 11px; font-weight: 700; color: #ff5c77; }
#q:not(:placeholder-shown) + .hint { display: none; }
#q:focus { outline: none; }
#send {
  position: absolute; right: 14px; bottom: 12px; width: 44px; height: 44px;
  border-radius: 999px; border: 0; background: #71717a; color: #18181b;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color 0.15s ease;
}
#send.ready { background: #ffffff; }
#send:disabled { cursor: default; }

/* Turnstile shows itself only when Cloudflare wants a click; it floats so the layout never moves. */
.check { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5; }

/* Thin dark scrollbars (standard properties for Chrome and Firefox, the webkit ones for Safari). */
html, .log, #q { scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

.dis { margin: -16px 0 0; max-width: 640px; text-align: center; font-size: 13px; line-height: 1.6; color: #a1a1aa; }
.dis a { color: inherit; text-decoration: none; }
.dis a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .brand-name span { font-size: 24px; }
  .brand-name .evil { font-size: 10px; }
  .main { padding: 32px 0; gap: 28px; }
  .msg-user { max-width: 88%; }
}
