* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

:root {
  --bg: #030303;
  --panel: rgba(10, 10, 10, 0.92);
  --panel-soft: rgba(14, 14, 14, 0.88);
  --border: #232323;
  --border2: #3a3a3a;
  --text: #ffffff;
  --muted: #9a9a9a;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#particles-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  background: #030303;
}

.background-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.08), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.05), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.04), transparent 35%);
}

/* ================= HEADER ================= */

header {
  width: 100%;
  padding: 14px clamp(18px, 2.5vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  background: #000;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.14));
}

.logo {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.logo span {
  color: #bdbdbd;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #dcdcdc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

.online-pill strong {
  color: #fff;
  font-size: 13px;
}

.owner-login-btn {
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
  margin-left: 0;
}

.owner-login-btn:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.owner-login-btn.owner-active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  flex-wrap: nowrap;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.nav-btn {
  position: relative;
  min-width: 112px;
  height: 52px;
  padding: 0 22px;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: #d6d6d6;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 800;
  font-size: 15px;
}

.nav-btn:first-child {
  border-left: none;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 22px rgba(255, 255, 255, 0.14);
}

.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.65);
}

/* ================= LAYOUT ================= */

main {
  width: min(1700px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 2.8vw, 34px) 42px;
}

.section {
  display: none;
  animation: fade 0.25s ease-in-out;
}

.section.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= INÍCIO ================= */

.home-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.58fr);
  gap: 26px;
  align-items: start;
}

.home-chat-column,
.home-main-column {
  min-width: 0;
}

.home-main-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
  align-items: stretch;
}

.hero-box {
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.92), rgba(5, 5, 5, 0.82));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  position: relative;
  overflow: hidden;
  min-height: 270px;
}

.hero-box::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(35px);
}

.hero h1 {
  font-size: clamp(34px, 4vw, 64px);
  line-height: 1;
  margin-bottom: 14px;
  max-width: 820px;
  position: relative;
}

.hero p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
  max-width: 720px;
  margin-bottom: 24px;
  position: relative;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}

.btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  transition: 0.2s;
}

.btn-primary {
  background: #fff;
  color: #000;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid var(--border2);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

.stats {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 127px;
}

.stat-card h3 {
  font-size: 38px;
}

.stat-card p {
  color: var(--muted);
  margin-top: 6px;
  font-weight: 700;
}

/* ================= SEÇÕES ================= */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
}

.section-title h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  text-transform: uppercase;
}

.section-title p {
  color: var(--muted);
  margin-top: 9px;
  font-weight: 700;
}

.counter-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border2);
  color: #ddd;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: nowrap;
}

.search-area {
  margin: 22px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-area input,
.chat-inputs input,
.chat-inputs textarea {
  flex: 1;
  min-width: 220px;
  background: rgba(8, 8, 8, 0.82);
  border: 1px solid var(--border);
  color: #fff;
  padding: 15px 16px;
  border-radius: 14px;
  outline: none;
  font-weight: 700;
}

.search-area input:focus,
.chat-inputs input:focus,
.chat-inputs textarea:focus {
  border-color: #fff;
}

.ad-box {
  width: 100%;
  min-height: 86px;
  background: rgba(8, 8, 8, 0.72);
  border: 1px dashed #303030;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  text-align: center;
  padding: 20px;
  font-weight: 700;
}

.category-tabs {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 26px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(8, 8, 8, 0.72);
  border: 1px solid #181818;
}

.category-tabs button {
  background: transparent;
  border: 1px solid #2d2d2d;
  color: #cfcfcf;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  transition: 0.2s;
}

.category-tabs button:hover,
.category-tabs button.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* ================= CARDS ================= */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 22px;
  margin-top: 22px;
  justify-content: center;
}

.script-card,
.tutorial-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: 0.22s;
}

.script-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
}

.script-card:hover,
.tutorial-card:hover {
  transform: translateY(-5px);
  border-color: #555;
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.055);
}

.thumb {
  width: 100%;
  height: 220px;
  background: #080808;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: grayscale(1) contrast(1.08);
  transition: 0.25s;
  background: #080808;
}

.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, #101010, #050505),
    radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 45%);
}

.thumb-fallback::after {
  content: attr(data-title);
  color: #aaa;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  padding: 18px;
}

.script-card:hover .thumb img,
.tutorial-card:hover .thumb img {
  transform: scale(1.02);
  filter: grayscale(0.15) contrast(1.1);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 10px;
  min-height: 44px;
}

.creator {
  color: #a8a8a8;
  font-size: 13px;
  margin-bottom: 12px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag {
  display: inline-block;
  padding: 7px 10px;
  background: #090909;
  color: #d8d8d8;
  border: 1px solid #242424;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  margin-bottom: 15px;
  flex: 1;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #191919;
  padding-top: 13px;
  gap: 8px;
  margin-top: auto;
}

.meta div {
  text-align: center;
  border-right: 1px solid #191919;
}

.meta div:last-child {
  border-right: none;
}

.meta span {
  display: block;
  color: #777;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.meta strong {
  font-size: 13px;
  color: #fff;
}

.actions-area {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.7fr 0.7fr;
  gap: 9px;
}

.actions-area.no-video {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
}

.small-btn,
.video-btn,
.vote-btn,
.chat-send-btn {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #fff;
  color: #000;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
  font-weight: 900;
}

.video-btn,
.vote-btn {
  background: #101010;
  color: #fff;
  border-color: #292929;
}

.small-btn:hover,
.video-btn:hover,
.vote-btn:hover,
.chat-send-btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.vote-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.tutorial-card .thumb {
  height: 230px;
}

.tutorial-card .card-body {
  padding: 18px;
}

.tutorial-card .card-title {
  min-height: auto;
}

.tutorial-actions {
  display: flex;
  margin-top: 14px;
}

.tutorial-actions .video-btn {
  width: 100%;
}

/* ================= CHAT ================= */

.chat-box {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.home-chat-box {
  min-height: 100%;
  height: 100%;
}

.chat-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.chat-top h2 {
  font-size: 24px;
  text-transform: uppercase;
}

.chat-top span {
  color: #777;
  font-size: 12px;
  font-weight: 800;
}

.chat-messages {
  flex: 1;
  min-height: 520px;
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  margin-bottom: 16px;
}

.chat-message {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  padding: 12px;
}

.chat-message strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.chat-message p {
  color: #d0d0d0;
  line-height: 1.4;
  font-size: 13px;
  word-break: break-word;
}

.chat-message small {
  display: block;
  color: #666;
  margin-top: 8px;
  font-size: 11px;
}

.chat-inputs {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(180px, 1fr) 85px;
  gap: 12px;
  align-items: stretch;
  margin-top: auto;
}

.chat-inputs input,
.chat-inputs textarea {
  min-width: 0;
  width: 100%;
}

.chat-inputs textarea {
  resize: none;
  height: 50px;
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  vertical-align: middle;
}

.owner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000;
  display: inline-block;
}

.empty {
  color: #888;
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.7);
  padding: 22px;
  border-radius: 16px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px clamp(18px, 2.8vw, 34px);
  color: #777;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
}

/* ================= RESPONSIVO ================= */

@media (max-width: 1420px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-main-column {
    order: 1;
  }

  .home-chat-column {
    order: 2;
  }

  .chat-messages {
    min-height: 340px;
    max-height: 430px;
  }
}

@media (max-width: 1180px) {
  header {
    padding: 14px 22px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
  }

  .brand-area {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .owner-login-btn {
    margin-left: 0;
  }

  nav {
    width: 100%;
    border-radius: 16px;
  }

  .nav-btn {
    flex: 1;
    min-width: 0;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-box {
    min-height: auto;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards {
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    justify-content: stretch;
  }

  .category-tabs {
    justify-content: flex-start;
  }

  .category-tabs button {
    flex: 1;
    min-width: 130px;
  }
}

@media (max-width: 780px) {
  main {
    padding: 24px 16px 34px;
  }

  header {
    padding: 14px 16px;
  }

  .brand-area {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    gap: 10px;
  }

  .logo-wrap {
    flex: 0 1 auto;
    min-width: 0;
  }

  .online-pill {
    flex: 0 0 auto;
  }

  .owner-login-btn {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .site-logo {
    width: 38px;
    height: 38px;
  }

  .logo {
    font-size: 23px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .online-pill,
  .owner-login-btn {
    padding: 8px 11px;
    font-size: 11px;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    border: none;
    background: transparent;
    overflow: visible;
  }

  .nav-btn {
    border: 1px solid var(--border2);
    border-radius: 13px;
    height: 44px;
    min-width: 0;
    padding: 0 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.025);
  }

  .nav-btn:first-child {
    border-left: 1px solid var(--border2);
  }

  .hero-box {
    padding: 28px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: clamp(34px, 8vw, 52px);
  }

  .hero p {
    font-size: 15px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 115px;
  }

  .chat-inputs {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    min-height: 300px;
    max-height: 360px;
  }
}

@media (max-width: 560px) {
  .brand-area {
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo-wrap {
    width: 100%;
  }

  .site-logo {
    width: 34px;
    height: 34px;
  }

  .logo {
    font-size: 20px;
  }

  .online-pill {
    padding: 7px 10px;
    font-size: 10px;
  }

  .online-pill strong {
    font-size: 11px;
  }

  .online-dot {
    width: 6px;
    height: 6px;
  }

  .owner-login-btn {
    padding: 7px 10px;
    font-size: 10px;
    margin-left: 0;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-btn {
    height: 43px;
    font-size: 13px;
  }

  .hero-box {
    padding: 24px;
  }

  .hero h1 {
    font-size: clamp(31px, 10vw, 42px);
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .thumb {
    height: 180px;
  }

  .actions-area,
  .actions-area.no-video {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    min-height: 260px;
    max-height: 320px;
  }
}

@media (max-width: 420px) {
  .brand-area {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .logo-wrap {
    width: 100%;
  }

  .owner-login-btn {
    margin-left: 0;
  }

  .online-pill,
  .owner-login-btn {
    width: fit-content;
  }
}

@media (max-width: 380px) {
  main {
    padding: 20px 12px 30px;
  }

  header {
    padding: 12px;
  }

  .logo {
    font-size: 20px;
  }

  .site-logo {
    width: 34px;
    height: 34px;
  }

  .nav-btn {
    font-size: 12px;
    padding: 0 8px;
  }

  .hero-box {
    padding: 20px;
  }

  .hero h1 {
    font-size: 29px;
  }
}