:root {
  --bg: #070707;
  --bg2: #0e0e0e;
  --card: #141414;
  --card2: #1a1a1a;
  --line: rgba(255, 255, 255, 0.07);
  --red: #ff2b2b;
  --red2: #c81010;
  --text: #f4f4f5;
  --muted: #8e8e93;
  --dim: #636366;
  --radius: 18px;
  --tab: calc(56px + env(safe-area-inset-bottom, 0px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --fluid: clamp(15px, 3.9vw, 17px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fluid);
  line-height: 1.35;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

body {
  overflow: hidden;
}

#app {
  position: relative;
  height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 43, 43, 0.16), transparent 55%),
    var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 540px) {
  body {
    display: grid;
    place-items: center;
  }
  #app {
    width: min(390px, 100vw);
    height: min(844px, 96dvh);
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
}

.top {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
  min-height: calc(58px + env(safe-area-inset-top, 0px));
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand b {
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.brand span {
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.55);
  animation: pulse 1.8s var(--ease) infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(255, 43, 43, 0);
  }
}

.views {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
}

[data-view] {
  position: absolute;
  inset: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 4px 18px var(--tab);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.32s var(--ease), transform 0.42s var(--ease);
  -webkit-overflow-scrolling: touch;
}

[data-view].on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

[data-view="chat"].on {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.chat-on,
.thread-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-on.hidden,
.thread-view.hidden {
  display: none;
}

.gate .btn {
  margin: 12px auto 0;
  padding: 0 22px;
  width: auto;
  min-width: 140px;
}

.cell img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 36px;
}

.section {
  margin-top: 18px;
}

.row-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.row-title h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.row-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.plats {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 10px;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
  scrollbar-width: none;
}

.plats::-webkit-scrollbar {
  display: none;
}

.plat {
  flex: 0 0 148px;
  scroll-snap-align: start;
  text-align: left;
  animation: rise 0.55s var(--ease) both;
}

.plat:nth-child(2) {
  animation-delay: 0.06s;
}
.plat:nth-child(3) {
  animation-delay: 0.12s;
}
.plat:nth-child(4) {
  animation-delay: 0.18s;
}

.plat .art {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}

.plat .art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  animation: ken 16s ease-in-out infinite alternate;
}

@keyframes ken {
  to {
    transform: scale(1.1);
  }
}

.plat .ring {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 43, 43, 0.85);
  pointer-events: none;
}

.plat.off .ring {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

.plat .meta {
  margin-top: 8px;
}

.plat .meta b {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.plat .meta em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px 11px;
  min-height: 76px;
}

.step n {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.step b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.banca {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  animation: rise 0.5s var(--ease) both;
  text-align: left;
}

.banca .shot {
  aspect-ratio: 1;
  background: #101010;
  overflow: hidden;
}

.banca .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banca .info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 13px;
}

.banca .info img,
.banca .dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  background: #222;
  flex: 0 0 34px;
}

.banca .info div {
  min-width: 0;
  flex: 1;
}

.banca .info b {
  display: block;
  font-size: 14px;
  font-weight: 650;
}

.banca .info em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  margin-top: 1px;
}

.banca .kill {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--dim);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 12px;
  font-size: 14px;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: var(--tab);
  padding: 6px 10px env(safe-area-inset-bottom, 8px);
  display: flex;
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  border-top: 1px solid var(--line);
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.tabbar button .i {
  width: 22px;
  height: 22px;
  transition: transform 0.28s var(--ease);
}

.tabbar button.on {
  color: var(--red);
}

.tabbar button.on .i {
  transform: translateY(-1px) scale(1.06);
}

.tabbar button:active {
  transform: scale(0.96);
}

.i {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.i-home {
  --src: url("/assets/icons/home.svg");
}
.i-bancas {
  --src: url("/assets/icons/bancas.svg");
}
.i-chat {
  --src: url("/assets/icons/chat.svg");
}
.i-user {
  --src: url("/assets/icons/user.svg");
}
.i-send {
  --src: url("/assets/icons/send.svg");
}
.i-plus {
  --src: url("/assets/icons/plus.svg");
}
.i-close {
  --src: url("/assets/icons/close.svg");
}
.i-check {
  --src: url("/assets/icons/check.svg");
}
.i-lock {
  --src: url("/assets/icons/lock.svg");
}
.i-image {
  --src: url("/assets/icons/image.svg");
}
.i-logout {
  --src: url("/assets/icons/logout.svg");
}
.i-link {
  --src: url("/assets/icons/link.svg");
}
.i-chevron {
  --src: url("/assets/icons/chevron.svg");
}

.press {
  transition: transform 0.18s var(--ease);
}
.press:active {
  transform: scale(0.97);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 0;
}

.chat-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px 12px;
}

.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
  animation: pop 0.28s var(--ease) both;
  word-break: break-word;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

.bubble.ana {
  align-self: flex-start;
  background: #1c1c1e;
  border-bottom-left-radius: 6px;
}

.bubble.me {
  align-self: flex-end;
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble time {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.55;
  font-weight: 600;
}

.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0 calc(12px + var(--tab));
  flex: 0 0 auto;
  background: var(--bg);
}

.composer input {
  flex: 1;
  height: 44px;
  border: 0;
  outline: 0;
  background: #1c1c1e;
  border-radius: 22px;
  padding: 0 16px;
  font-size: 16px;
}

.composer button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  transition: transform 0.2s var(--ease), filter 0.2s;
}

.composer button:active {
  transform: scale(0.92);
}

.gate {
  display: grid;
  place-items: center;
  height: 70%;
  text-align: center;
  gap: 14px;
  color: var(--muted);
}

.gate .i {
  width: 36px;
  height: 36px;
  color: var(--red);
  margin: 0 auto 6px;
}

.gate p {
  font-size: 14px;
}

.auth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
}

.auth input {
  height: 50px;
  border: 0;
  outline: 0;
  background: #1c1c1e;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
}

.btn {
  height: 50px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: grid;
  place-items: center;
  transition: transform 0.18s var(--ease), filter 0.18s;
}

.btn:active {
  transform: scale(0.98);
}

.btn.red {
  background: linear-gradient(#ff4040, var(--red2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 43, 43, 0.22);
}

.btn.ghost {
  color: var(--muted);
  height: 40px;
}

.me-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--red);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  flex: 0 0 46px;
}

.me-card b {
  display: block;
  font-size: 16px;
}

.me-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  margin-top: 2px;
}

.list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
}

.cell span {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.cell em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
}

.cell .i {
  color: var(--muted);
}

.thread {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 8px;
}

.thread b {
  display: block;
  font-size: 14px;
}

.thread em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
  z-index: 20;
}

.sheet-bg.on {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  background: #121212;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 10px));
  transform: translateY(110%);
  transition: transform 0.42s var(--ease);
  max-height: 86%;
  overflow: auto;
  pointer-events: none;
}

.sheet.on {
  transform: none;
  pointer-events: auto;
}

.grab {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #3a3a3c;
  margin: 4px auto 14px;
}

.sheet-plat {
  display: flex;
  gap: 14px;
  align-items: center;
}

.sheet-plat img {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
}

.sheet-plat b {
  display: block;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.sheet-plat em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.sheet .btn {
  margin-top: 16px;
  width: 100%;
}

.field {
  margin-top: 10px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  border: 0;
  outline: 0;
  background: #1c1c1e;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 16px;
  appearance: none;
}

.field textarea {
  height: 88px;
  padding: 12px 14px;
  resize: none;
}

.pick {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  background: #1c1c1e;
  border-radius: 14px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.err {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  font-weight: 600;
}

.hint {
  color: var(--dim);
  font-size: 12px;
  text-align: center;
  margin-top: 16px;
}

.back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.fab {
  position: absolute;
  right: 16px;
  bottom: calc(var(--tab) + 14px);
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(255, 43, 43, 0.28);
  z-index: 6;
}

.fab .i {
  display: none;
}

.fab::before,
.fab::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 2px;
}

.fab::before {
  width: 16px;
  height: 2px;
}

.fab::after {
  width: 2px;
  height: 16px;
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
