/* ==========================================================================
   DESIGN DE NUI — RIO ROLEPLAY (PADRÃO OFICIAL)
   Tokens, tipografia, layout e componentes fiéis a DESIGN.md
   ========================================================================== */

/* 1. RESET OBRIGATÓRIO & FONTES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0 !important;
}

:root {
  --u: clamp(0.85px, calc(100vh / 1080), 2px);

  /* Destaque fixo (Rio Roleplay) */
  --rio-accent: #c00000;                        /* fundo de ícones de ação, selo de dono, item ativo */
  --rio-accent-dim: #990000;                    /* hover/pressionado sobre o destaque */
  --rio-accent-soft: rgba(192, 0, 0, 0.12);     /* realce leve, foco de campo */

  /* Base */
  --rio-dark: #161616;                          /* texto e ícone sobre destaque ou sobre branco */
  --rio-bg: rgba(22, 22, 22, 0.97);             /* fundo do modal/container */
  --rio-text: #ffffff;
  --rio-faint: rgba(255, 255, 255, 0.4);        /* rótulos, subtítulos, status inativo */

  --rio-danger: #f17c83;
  --rio-ok: #8fe3a6;

  /* Neutros */
  --rio-muted: rgba(255, 255, 255, 0.6);        /* texto corrido (mensagem, dica) */
  --rio-surface: rgba(255, 255, 255, 0.03);     /* linha de lista / superfície */
  --rio-surface-hover: rgba(255, 255, 255, 0.05);
  --rio-surface-active: rgba(255, 255, 255, 0.07);
  --rio-chip: rgba(255, 255, 255, 0.06);        /* selo inativo, botão redondo inativo */
  --rio-line: rgba(255, 255, 255, 0.07);        /* divisórias e bordas de 1 px */
  --rio-sunken: rgba(0, 0, 0, 0.2);             /* fundo do card de detalhe */

  /* Vidro moderno embaçado (Glassmorphism) */
  --rio-glass: rgba(255, 255, 255, 0.08);        /* fundo translúcido do card de vidro */
  --rio-glass-strong: rgba(255, 255, 255, 0.10); /* vidro um pouco mais opaco (modal) */
  --rio-glass-border: rgba(255, 255, 255, 0.18); /* borda de vidro */
  --rio-glass-blur: 30px;                        /* intensidade do embaçado */
  --rio-glass-saturate: 160%;
  --rio-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);

  --rio-inner-shadow: inset 0 0 calc(var(--u) * 34.9) calc(var(--u) * 35) rgba(0, 0, 0, 0.12);
}

/* Corpo e Fundo */
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--rio-text);
  background-color: #0e0e0e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Banner desfocado ao fundo (camada fixa atrás do conteúdo) */
body::before {
  content: "";
  position: fixed;
  inset: -24px;
  z-index: -2;
  background: url('/images/banner.jpg') center / cover no-repeat;
  filter: blur(8px) brightness(0.85) saturate(1.1);
  transform: scale(1.06);
  pointer-events: none;
}

/* Véu escuro + brilho suave por cima do banner */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 50% 20%, rgba(192,0,0, 0.08) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(14, 14, 14, 0.55), rgba(18, 18, 18, 0.7));
  pointer-events: none;
}

/* Tipografia */
.rio-font-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3, .rio-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

/* Barra de rolagem nativa estilizada */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb {
  background: #ffffff;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rio-accent);
}

/* ==========================================================================
   2. COMPONENTES OFICIAIS DO MODAL & NUI (DESIGN.md)
   ========================================================================== */

/* Camada de vidro compartilhada (não borra o conteúdo/texto) */
.rio-navbar,
.rio-footer,
.rio-modal,
.rio-panel,
.rio-hint,
.rio-detail {
  background: transparent;
  isolation: isolate;
}

.rio-navbar::before,
.rio-footer::before,
.rio-modal::before,
.rio-panel::before,
.rio-hint::before,
.rio-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--rio-glass);
  -webkit-backdrop-filter: blur(var(--rio-glass-blur)) saturate(var(--rio-glass-saturate));
  backdrop-filter: blur(var(--rio-glass-blur)) saturate(var(--rio-glass-saturate));
  pointer-events: none;
}

.rio-modal::before {
  background: var(--rio-glass-strong);
}

/* Navbar do Topo */
.rio-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rio-glass-border);
  box-shadow: var(--rio-glass-shadow);
}

/* Rodapé de Vidro */
.rio-footer {
  position: relative;
  border-top: 1px solid var(--rio-glass-border);
  box-shadow: var(--rio-glass-shadow);
}

/* Container Modal / Card Principal */
.rio-modal {
  position: relative;
  border: 1px solid var(--rio-glass-border);
  border-radius: calc(var(--u) * 12);
  box-shadow: var(--rio-glass-shadow), 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.rio-panel {
  position: relative;
  border: 1px solid var(--rio-glass-border);
  border-radius: calc(var(--u) * 12);
  box-shadow: var(--rio-glass-shadow);
}

/* Cabeçalho da Seção (7.2) */
.rio-head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 17);
  margin-bottom: calc(var(--u) * 24);
}

.rio-head__icon {
  width: calc(var(--u) * 32);
  height: calc(var(--u) * 32);
  min-width: calc(var(--u) * 32);
  border-radius: 50%;
  background: var(--rio-accent);
  color: var(--rio-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 15);
}

.rio-head__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(var(--u) * 18);
  font-weight: 800;
  color: var(--rio-text);
  text-transform: uppercase;
  line-height: 1;
}

.rio-head__sub {
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  color: var(--rio-faint);
  margin-top: 4px;
}

/* Rótulo da Lista e Contador (7.3) */
.rio-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 14);
  color: var(--rio-faint);
  margin-bottom: calc(var(--u) * 12);
}

.rio-count {
  font-weight: 400;
  color: var(--rio-faint);
}

.rio-count b {
  font-weight: 600;
  color: var(--rio-text);
}

/* Linha de Lista (7.4) */
.rio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--u) * 44);
  padding: calc(var(--u) * 8) calc(var(--u) * 14);
  background: var(--rio-surface);
  border: 1px solid var(--rio-line);
  border-radius: calc(var(--u) * 3);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: calc(var(--u) * 8);
}

.rio-row:hover {
  background: var(--rio-surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.rio-row.is-active {
  background: var(--rio-surface-active);
  border-color: rgba(255, 255, 255, 0.18);
}

.rio-row__name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 14);
  font-weight: 500;
  color: var(--rio-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selo de Status (7.5) */
.rio-status {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--u) * 7);
  height: calc(var(--u) * 26);
  padding: 0 calc(var(--u) * 12);
  border-radius: calc(var(--u) * 3);
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  font-weight: 600;
  background: var(--rio-chip);
  color: var(--rio-faint);
  line-height: 1;
  white-space: nowrap;
}

.rio-status.is-ok, .rio-status--ok {
  background: rgba(143, 227, 166, 0.1);
  color: var(--rio-ok);
  border: 1px solid rgba(143, 227, 166, 0.2);
}

.rio-status.is-danger, .rio-status--danger {
  background: rgba(241, 124, 131, 0.1);
  color: var(--rio-danger);
  border: 1px solid rgba(241, 124, 131, 0.2);
}

.rio-status.is-pending, .rio-status--pending {
  background: rgba(192,0,0, 0.1);
  color: var(--rio-accent);
  border: 1px solid rgba(192,0,0, 0.2);
}

.rio-row.is-active .rio-status {
  background: #ffffff;
  color: var(--rio-dark);
}

/* Dica do Rodapé (7.7) */
.rio-hint {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 15);
  padding: calc(var(--u) * 12) calc(var(--u) * 16);
  position: relative;
  border: 1px solid var(--rio-glass-border);
  border-radius: calc(var(--u) * 6);
  box-shadow: var(--rio-glass-shadow);
  margin-top: calc(var(--u) * 20);
}

.rio-hint__icon {
  width: calc(var(--u) * 34);
  height: calc(var(--u) * 34);
  min-width: calc(var(--u) * 34);
  border-radius: calc(var(--u) * 8);
  background: var(--rio-accent);
  color: var(--rio-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 16);
}

.rio-hint p {
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 13);
  color: var(--rio-faint);
  line-height: 1.35;
}

/* Card de Detalhe (7.8) */
.rio-detail {
  position: relative;
  border: 1px solid var(--rio-glass-border);
  border-radius: calc(var(--u) * 4);
  box-shadow: var(--rio-glass-shadow);
  overflow: hidden;
}

.rio-detail__cover {
  position: relative;
  height: calc(var(--u) * 165);
  border-bottom: 1px solid var(--rio-glass-border);
  background: rgba(255, 255, 255, 0.04);
}

.rio-detail__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rio-detail__chips {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  display: flex;
  gap: calc(var(--u) * 8);
  z-index: 2;
}

/* Selos sobre a capa */
.rio-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--u) * 8);
  height: calc(var(--u) * 28);
  padding: 0 calc(var(--u) * 14);
  border-radius: calc(var(--u) * 3);
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  font-weight: 600;
  background: var(--rio-dark);
  color: var(--rio-text);
  line-height: 1;
  border: 1px solid var(--rio-line);
}

.rio-chip--owner {
  background: var(--rio-accent);
  color: var(--rio-dark);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(var(--u) * 11);
  font-weight: 800;
  text-transform: uppercase;
  border: 0;
}

.rio-detail__body {
  padding: calc(var(--u) * 28) calc(var(--u) * 24) calc(var(--u) * 24);
}

.rio-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: calc(var(--u) * 20);
}

.rio-detail__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(var(--u) * 18);
  font-weight: 800;
  color: var(--rio-text);
  text-transform: uppercase;
  line-height: 1.1;
}

.rio-detail__sub {
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  color: var(--rio-faint);
  margin-top: 4px;
}

/* Blocos do detalhe */
.rio-block {
  margin-bottom: calc(var(--u) * 20);
}

.rio-block__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(var(--u) * 14);
  font-weight: 800;
  color: var(--rio-text);
  text-transform: uppercase;
  margin-bottom: calc(var(--u) * 8);
  line-height: 1;
}

.rio-block__text {
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  color: var(--rio-muted);
  line-height: 1.4;
}

/* ==========================================================================
   3. BOTÕES (7.9)
   ========================================================================== */
.rio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 8);
  height: calc(var(--u) * 36);
  min-height: 36px;
  padding: 0 calc(var(--u) * 18);
  border-radius: calc(var(--u) * 3);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: all 0.15s ease;
}

/* Botão Primário (Vermelho sangue #c00000) */
.rio-btn--primary {
  background: var(--rio-accent);
  color: var(--rio-dark);
}
.rio-btn--primary:hover {
  background: var(--rio-accent-dim);
}

/* Botão Ghost / Neutro */
.rio-btn--ghost {
  background: var(--rio-chip);
  color: var(--rio-text);
  border: 1px solid var(--rio-line);
}
.rio-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Botão Perigo / Recusar */
.rio-btn--danger {
  background: var(--rio-chip);
  color: var(--rio-danger);
  border: 1px solid rgba(241, 124, 131, 0.2);
}
.rio-btn--danger:hover {
  background: rgba(241, 124, 131, 0.12);
}

/* Botão Sucesso / Confirmar */
.rio-btn--ok {
  background: var(--rio-chip);
  color: var(--rio-ok);
  border: 1px solid rgba(143, 227, 166, 0.2);
}
.rio-btn--ok:hover {
  background: rgba(143, 227, 166, 0.12);
}

/* Botão Redondo (Ação rápida) */
.rio-round {
  width: calc(var(--u) * 30);
  height: calc(var(--u) * 30);
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  background: var(--rio-accent);
  color: var(--rio-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 13);
  border: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rio-round:hover {
  background: var(--rio-accent-dim);
}

.rio-round--ghost {
  background: var(--rio-chip);
  color: var(--rio-faint);
}
.rio-round--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--rio-text);
}

/* Botão Discord Oficial */
.rio-btn--discord {
  background: #5865F2;
  color: #ffffff;
}
.rio-btn--discord:hover {
  background: #4752c4;
}

/* Efeito de brilho passando no hover */
.rio-btn,
.rio-round,
.rio-nav__btn {
  position: relative;
  overflow: hidden;
}

.rio-btn::after,
.rio-round::after,
.rio-nav__btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: translateX(-250%) skewX(-20deg);
  transition: transform 0.65s ease;
  pointer-events: none;
  z-index: 3;
}

.rio-btn:hover::after,
.rio-round:hover::after,
.rio-nav__btn:hover::after {
  transform: translateX(350%) skewX(-20deg);
}

@media (prefers-reduced-motion: reduce) {
  .rio-btn::after,
  .rio-round::after,
  .rio-nav__btn::after {
    display: none;
  }
}

/* ==========================================================================
   4. CAMPOS DE FORMULÁRIO (7.10)
   ========================================================================== */
.rio-input, .rio-textarea {
  width: 100%;
  height: calc(var(--u) * 38);
  min-height: 38px;
  background-color: #161616;
  border: 1px solid var(--rio-line);
  border-radius: calc(var(--u) * 3);
  padding: 0 calc(var(--u) * 14);
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 13);
  font-weight: 500;
  color: var(--rio-text);
  outline: none;
  transition: all 0.15s ease;
}

.rio-textarea {
  height: auto;
  min-height: 85px;
  padding: calc(var(--u) * 10) calc(var(--u) * 14);
  resize: vertical;
}

.rio-input::placeholder, .rio-textarea::placeholder {
  color: var(--rio-faint);
}

.rio-input:focus, .rio-textarea:focus {
  border-color: var(--rio-accent);
  background-color: #1a1a1a;
  box-shadow: 0 0 0 1px var(--rio-accent);
}

/* Select customizado NUI com fundo escuro e seta azul */
.rio-select {
  width: 100%;
  height: calc(var(--u) * 38);
  min-height: 38px;
  background-color: #161616 !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c00000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 14px !important;
  border: 1px solid var(--rio-line);
  border-radius: calc(var(--u) * 3);
  padding: 0 38px 0 calc(var(--u) * 14);
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 13);
  font-weight: 500;
  color: #ffffff !important;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.15s ease;
}

.rio-select:focus {
  border-color: var(--rio-accent);
  background-color: #1a1a1a !important;
  box-shadow: 0 0 0 1px var(--rio-accent);
}

/* Opções do Select (Garante fundo escuro e texto legível em todos os navegadores) */
.rio-select option {
  background-color: #161616 !important;
  color: #ffffff !important;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  padding: 10px 14px;
}

.rio-select option:hover,
.rio-select option:focus,
.rio-select option:checked {
  background-color: #242424 !important;
  color: var(--rio-accent) !important;
}

.rio-field-label {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(var(--u) * 12);
  font-weight: 500;
  color: var(--rio-faint);
  margin-bottom: calc(var(--u) * 6);
}

.rio-field-label span.req {
  color: var(--rio-accent);
}

/* ==========================================================================
   5. NAVEGAÇÃO LATERAL (7.1)
   ========================================================================== */
.rio-nav {
  width: calc(var(--u) * 75);
  min-width: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--u) * 24);
  gap: calc(var(--u) * 14);
  border-right: 1px solid var(--rio-line);
}

.rio-nav__btn {
  width: calc(var(--u) * 38);
  height: calc(var(--u) * 38);
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  background: var(--rio-chip);
  color: var(--rio-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 16);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.rio-nav__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--rio-text);
}

.rio-nav__btn.is-active {
  background: var(--rio-accent);
  color: var(--rio-dark);
}
