:root {
  --ink: #09070a;
  --paper: #120d12;
  --panel: rgba(28, 18, 24, 0.72);
  --line: rgba(255, 214, 170, 0.14);
  --gold: #e2b657;
  --gold-soft: #f6d98a;
  --silver: #c9d0d6;
  --cream: #f7efe2;
  --mute: #b09a8c;
  --danger: #e06a4e;
  --ok: #86c07a;
  --rose: #c45c72;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

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

html, body {
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: Outfit, system-ui, sans-serif;
}

body {
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(196, 92, 114, 0.28), transparent 55%),
    radial-gradient(800px 460px at 92% 8%, rgba(226, 182, 87, 0.18), transparent 50%),
    radial-gradient(700px 500px at 70% 110%, rgba(90, 40, 80, 0.35), transparent 55%),
    linear-gradient(180deg, #140c12 0%, #09070a 100%);
}

.grain, .orb, .orb2 {
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.grain {
  inset: 0;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.orb {
  width: 420px;
  height: 420px;
  left: -80px;
  top: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 92, 114, 0.28), transparent 68%);
  filter: blur(8px);
  animation: drift 14s ease-in-out infinite;
}

.orb2 {
  width: 360px;
  height: 360px;
  right: -60px;
  bottom: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 182, 87, 0.2), transparent 68%);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite reverse;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 16px 56px;
}

.hero-inner {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 18px;
}

.seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--gold-soft);
  box-shadow: inset 0 0 16px rgba(226, 182, 87, 0.28), 0 0 18px rgba(226, 182, 87, 0.12);
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 600;
  line-height: 0.9;
  max-width: 11ch;
  letter-spacing: -0.03em;
}

.lede {
  margin-top: 20px;
  color: var(--mute);
  max-width: 42ch;
  font-weight: 300;
  line-height: 1.7;
  font-size: 16px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 236, 214, 0.07), rgba(20, 12, 16, 0.55));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.entry {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

input[type="text"], textarea, input[type="number"] {
  background: rgba(8, 6, 8, 0.7);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  width: 100%;
}

input:focus, textarea:focus {
  border-color: rgba(226, 182, 87, 0.6);
  box-shadow: 0 0 0 4px rgba(226, 182, 87, 0.08);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 500;
  background: linear-gradient(180deg, #f3d27a, #c8942c);
  color: #1a1408;
  box-shadow: 0 10px 24px rgba(201, 148, 44, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
  box-shadow: none;
}

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

.err {
  color: #efb4a4;
  font-size: 13px;
  min-height: 18px;
}

.letters {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 6px;
}

.letter {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 9, 12, 0.7);
  color: var(--cream);
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.letter:hover { transform: translateY(-2px); border-color: rgba(246, 217, 138, 0.4); }

.letter.on {
  background: radial-gradient(circle at 30% 20%, #f6d98a, #b07a22);
  color: #1a1204;
  border-color: var(--gold);
  box-shadow: 0 8px 18px rgba(176, 122, 34, 0.35);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.coins { display: flex; gap: 10px; }

.coin {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(255, 236, 214, 0.04);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.gold { background: radial-gradient(circle at 30% 30%, #ffe08a, #b8860b); }
.dot.silver { background: radial-gradient(circle at 30% 30%, #f3f6f8, #8d979f); }

.grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.panel { padding: 18px; }

.people { display: grid; gap: 8px; }

.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 10, 0.5);
  color: inherit;
  width: 100%;
  text-align: left;
}

.person.me {
  border-color: rgba(226, 182, 87, 0.5);
  background: rgba(226, 182, 87, 0.08);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  background: radial-gradient(circle at 30% 20%, #3a2a28, #1a1214);
  border: 1px solid var(--gold);
}

.suggest {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 12px;
  scrollbar-width: thin;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(16, 10, 14, 0.8);
  color: var(--cream);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 13px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip:hover { border-color: var(--gold); background: rgba(226, 182, 87, 0.08); }

.ask { display: grid; gap: 12px; }

.vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feed {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.qcard { padding: 18px; }

.qmeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.qtext {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  margin: 12px 0;
  line-height: 1.22;
}

.answer {
  color: var(--gold-soft);
  font-style: italic;
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
}

.pending { border-color: rgba(224, 106, 78, 0.45); }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #2a161c;
  border: 1px solid rgba(224, 106, 78, 0.5);
  padding: 14px 16px;
  border-radius: 16px;
  max-width: 360px;
  box-shadow: var(--shadow);
  z-index: 5;
}

.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; }
.small { color: var(--mute); font-size: 13px; line-height: 1.5; }

.cats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cat {
  text-align: left;
  background: rgba(12, 8, 10, 0.65);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--cream);
  display: grid;
  gap: 4px;
  min-height: 92px;
}

.cat span {
  color: var(--mute);
  font-size: 12px;
  font-weight: 300;
}

.cat.on.normal { border-color: #7aa36a; background: rgba(122, 163, 106, 0.14); }
.cat.on.picante { border-color: #d4af37; background: rgba(212, 175, 55, 0.14); }
.cat.on.fogo { border-color: #c45c3e; background: rgba(196, 92, 62, 0.18); }
.cat:disabled { cursor: default; opacity: 0.88; }

.heat {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}

.heat.normal { color: #b7d3aa; border-color: rgba(122, 163, 106, 0.45); }
.heat.picante { color: var(--gold-soft); border-color: rgba(212, 175, 55, 0.45); }
.heat.fogo { color: #efb4a4; border-color: rgba(196, 92, 62, 0.55); }

.chip.picante { border-color: rgba(212, 175, 55, 0.35); }
.chip.fogo { border-color: rgba(196, 92, 62, 0.45); }

.filepick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--mute);
  font-size: 13px;
  cursor: pointer;
}

.filepick input { display: none; }
.filepick.on {
  border-style: solid;
  border-color: rgba(196, 92, 62, 0.5);
  color: var(--cream);
}

.burn { color: #efb4a4; font-size: 13px; margin: 8px 0; }

.rescue textarea { margin-top: 8px; }

.veil {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 8, 0.86);
  display: grid;
  place-items: center;
  z-index: 8;
  padding: 20px;
}

.viewer {
  width: min(640px, 100%);
  display: grid;
  gap: 14px;
}

.viewer img, .viewer video {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.viewer audio { width: 100%; }

.kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--mute);
  text-align: center;
  line-height: 1.5;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .hero-inner, .grid, .lobby-grid, .cats { grid-template-columns: 1fr; }
  .letters { grid-template-columns: repeat(7, 1fr); }
  h1 { max-width: 12ch; }
}
