/* ==========================================================================
   Wiki CSS - Idêntico ao padrão Cobblemon Realms
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #191919;
  --sidebar: #1d1d1d;
  --surface: #202020;
  --surface-2: #282828;
  --surface-3: #303030;
  --text: #f5f5f5;
  --muted: #a7a7a7;
  --line: #383838;
  --accent: #4c91ff;
  --accent-soft: rgba(76, 145, 255, 0.12);
  --success: #20c875;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #8b5cf6;
  --content-width: 1040px;
  --content-width-wide: 1260px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --sidebar: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e7ebf1;
  --text: #18202b;
  --muted: #667181;
  --line: #d7dde6;
  --accent: #286fdb;
  --accent-soft: rgba(40, 111, 219, 0.1);
  --success: #168657;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================================
   Top Bar (Header)
   ========================================================================== */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(25, 25, 25, 0.96);
  backdrop-filter: blur(14px);
  transform: translateZ(0); /* Aceleração de hardware */
  will-change: transform;
  transition: background 0.2s ease, border-color 0.2s ease;
}

html[data-theme="light"] .topbar {
  background: rgba(245, 247, 251, 0.94);
  box-shadow: 0 3px 18px rgba(27, 39, 55, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, transform 0.15s ease;
}

html[data-theme="light"] .brand {
  color: #111827;
}

.brand:hover {
  color: #dbe9ff;
  transform: translateY(-1px);
}

.brand-copy {
  display: block;
  line-height: 1;
}

.brand-copy strong {
  display: flex;
  align-items: center;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.brand-copy small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-version {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(76, 145, 255, 0.4);
  border-radius: 999px;
  background: rgba(76, 145, 255, 0.12);
  color: #8ab4ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.025em;
  text-transform: none;
}

html[data-theme="light"] .brand-version {
  border-color: rgba(40, 111, 219, 0.32);
  background: rgba(40, 111, 219, 0.09);
  color: #245fae;
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ==========================================================================
   Search Box
   ========================================================================== */

.search-wrap {
  position: relative;
  max-width: 480px;
  width: 100%;
}

.search-icon {
  position: absolute;
  z-index: 2;
  left: 15px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-58%);
  border: 2px solid #9b9b9b;
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: #9b9b9b;
}

.search-wrap input {
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 74px 0 42px;
  border: 1px solid #454545;
  border-radius: 12px;
  outline: none;
  background: #202020;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

html[data-theme="light"] .search-wrap input {
  border-color: #cfd6e0;
  background: #ffffff;
  color: #18202b;
}

.search-wrap input::placeholder {
  color: #919191;
}

.search-wrap input:focus {
  border-color: #687890;
  background: #232323;
  box-shadow: 0 0 0 3px rgba(76, 145, 255, 0.13);
}

html[data-theme="light"] .search-wrap input:focus {
  border-color: #5f86bd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 111, 219, 0.12);
}

.search-wrap kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 7px;
  border: 1px solid #4c4c4c;
  border-radius: 6px;
  background: #292929;
  color: #c5c5c5;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}

html[data-theme="light"] .search-wrap kbd {
  border-color: #d0d7e1;
  background: #edf1f6;
  color: #687486;
}

.search-results {
  position: absolute;
  z-index: 80;
  top: 48px;
  left: 0;
  right: 0;
  max-height: 430px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #454545;
  border-radius: 13px;
  background: #202020;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
}

html[data-theme="light"] .search-results {
  border-color: #d4dbe5;
  background: #fff;
  box-shadow: 0 20px 55px rgba(27, 39, 55, 0.16);
}

.search-results[hidden] {
  display: none;
}

/* Chips de Categoria na Busca */
.search-chips {
  display: flex;
  gap: 6px;
  padding: 6px 6px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.search-chip {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.search-chip:hover,
.search-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Botão Widget de Copiar IP */
.server-ip-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(76, 145, 255, 0.4);
  border-radius: 9px;
  background: rgba(76, 145, 255, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.server-ip-btn:hover {
  background: rgba(76, 145, 255, 0.16);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.server-ip-btn .ip-icon {
  font-size: 14px;
}

.server-ip-btn .ip-copied-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 4px 10px;
  border-radius: 6px;
  background: #20c875;
  color: #0b291a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.server-ip-btn.copied .ip-copied-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}

.search-results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
}

.search-results a:hover,
.search-results a.is-active {
  background: #2d2d2d;
}

html[data-theme="light"] .search-results a:hover,
html[data-theme="light"] .search-results a.is-active {
  background: #eef3f9;
}

.search-results strong {
  font-size: 14px;
}

.search-results span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ==========================================================================
   Header Badges & Toggles
   ========================================================================== */

.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #454545;
  border-radius: 9px;
  background: #202020;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.15s ease;
}

.community-badge:hover {
  transform: translateY(-1px);
  border-color: #687890;
}

.server-badge.is-online {
  border-color: #2e8f5c !important;
  background: linear-gradient(180deg, rgba(46, 143, 92, 0.35), rgba(46, 143, 92, 0.15)) !important;
  box-shadow: 0 0 12px rgba(46, 143, 92, 0.2) !important;
}

.server-badge.is-offline {
  border-color: #c53030 !important;
  background: linear-gradient(180deg, rgba(197, 48, 48, 0.35), rgba(197, 48, 48, 0.15)) !important;
  box-shadow: 0 0 12px rgba(197, 48, 48, 0.2) !important;
}

.server-badge.is-offline .server-state i {
  background: #ef4444 !important;
}

/* Banner de Anúncio Global da Staff */
.wiki-announcement-banner {
  margin: 0 0 24px;
  padding: 12px 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(76, 145, 255, 0.12);
  border-color: rgba(76, 145, 255, 0.35);
  color: #dbe9ff;
  animation: fadeInBanner 0.3s ease;
}

.wiki-announcement-banner.success {
  background: rgba(32, 200, 117, 0.15);
  border-color: rgba(32, 200, 117, 0.4);
  color: #bbf7d0;
}

.wiki-announcement-banner.warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.wiki-announcement-banner a {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12.5px;
  text-decoration: none;
}

.wiki-announcement-banner a:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

@keyframes fadeInBanner {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.server-badge .server-state i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: #20c875;
}

.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #454545;
  border-radius: 11px;
  background: #202020;
  color: #d9dbe2;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

html[data-theme="light"] .theme-toggle {
  border-color: #cfd6e0;
  background: #fff;
  color: #344054;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: #687890;
  background: #292929;
}

html[data-theme="light"] .theme-toggle:hover {
  background: #f4f7fb;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: grid;
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.reading-progress {
  position: fixed;
  z-index: 120;
  top: 61px;
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  opacity: 1;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #4c91ff, #8b5cf6);
  box-shadow: 0 0 10px rgba(76, 145, 255, 0.45);
  will-change: transform;
}

/* ==========================================================================
   3-Column Layout
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  min-height: 100vh;
  padding-top: 62px;
}

/* ==========================================================================
   Left Sidebar
   ========================================================================== */

#sidebar {
  position: fixed;
  top: 62px;
  bottom: 0;
  width: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 10px 24px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  scrollbar-color: #676767 transparent;
  scrollbar-width: thin;
}

html[data-theme="light"] #sidebar {
  background: var(--sidebar);
}

.sidebar-navigation {
  flex: 1 0 auto;
}

.nav-group {
  margin: 0 0 8px;
  border: 0;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: #f4f4f4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.035em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

html[data-theme="light"] .nav-group summary {
  color: #253043;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary:hover,
.nav-group[open] summary {
  background: #292929;
}

html[data-theme="light"] .nav-group summary:hover,
html[data-theme="light"] .nav-group[open] summary {
  background: #e2e7ee;
}

.nav-chevron {
  width: 7px;
  height: 7px;
  margin-right: 3px;
  transform: rotate(45deg);
  border-right: 1.5px solid #b7b7b7;
  border-bottom: 1.5px solid #b7b7b7;
  transition: transform 0.16s ease;
}

.nav-group:not([open]) .nav-chevron {
  transform: rotate(-45deg);
}

.nav-group ul {
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}

.nav-group li a {
  display: block;
  margin: 1px 0;
  padding: 7px 12px 7px calc(12px + var(--depth, 0) * 18px);
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.12s ease, background 0.12s ease;
}

.nav-group li a:hover {
  background: #272727;
  color: var(--text);
}

html[data-theme="light"] .nav-group li a:hover {
  background: #e4e9f0;
}

.nav-group li a.active {
  background: #252a31;
  color: #66a5ff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

html[data-theme="light"] .nav-group li a.active {
  background: #e1ebf8;
  color: #1f66c2;
}

/* Sidebar Footer / Credits */
.sidebar-credits {
  margin-top: auto;
  padding: 20px 12px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-credits-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #e7e7ea;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] .sidebar-credits-title {
  color: #2d3748;
}

.sidebar-credits-mark {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(76, 145, 255, 0.42);
  border-radius: 6px;
  background: rgba(76, 145, 255, 0.12);
  color: #8ab4ff;
  font-size: 11px;
  font-weight: 900;
}

.sidebar-credit-person {
  margin-top: 10px;
  padding-left: 28px;
}

.sidebar-credit-person strong {
  display: block;
  color: #ededf1;
  font-size: 12px;
}

html[data-theme="light"] .sidebar-credit-person strong {
  color: #2d3748;
}

.sidebar-credit-person small {
  display: block;
  margin-top: 2px;
  color: #888b92;
  font-size: 11px;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

main {
  grid-column: 2;
  min-width: 0;
  padding: 42px 36px 90px;
}

article {
  max-width: var(--content-width);
  margin: 0 auto;
}

.wide-content article,
.tools-page article,
body.has-wide-layout article {
  max-width: var(--content-width-wide);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  scroll-margin-top: 88px;
}

h1 {
  margin: 0 0 2.4rem;
  font-size: 2.35rem;
  font-weight: 800;
}

h2 {
  margin: 2.8rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.85rem;
}

h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.3rem;
}

h4 {
  margin: 1.7rem 0 0.7rem;
  font-size: 1.1rem;
}

::selection {
  background: rgba(76, 145, 255, 0.35);
  color: #ffffff;
}

html[data-theme="light"] ::selection {
  background: rgba(37, 99, 235, 0.22);
  color: #0f172a;
}

p {
  margin: 1.15rem 0;
  line-height: 1.74;
  color: var(--text);
}

article ul, article ol {
  padding-left: 1.65rem;
  margin: 1.1rem 0 1.4rem;
}

article li {
  margin-bottom: 0.55rem;
  line-height: 1.72;
}

article li > ul, article li > ol {
  margin: 0.4rem 0 0.5rem;
}

article strong, article b {
  font-weight: 700;
  color: #ffffff;
}

html[data-theme="light"] article strong,
html[data-theme="light"] article b {
  color: #0f172a;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Callouts / Hints */
.hint {
  margin: 1.5rem 0;
  overflow: hidden;
  border: 1px solid #3a3a3a;
  border-left: 4px solid var(--info);
  border-radius: 8px;
  background: #272727;
}

html[data-theme="light"] .hint {
  border-color: #d5dbe4;
  background: #eef1f5;
}

.hint > :first-child {
  margin-top: 0;
}

.hint > :last-child {
  margin-bottom: 0;
}

.hint > p, .hint > ul, .hint > ol {
  margin-left: 18px;
  margin-right: 18px;
}

.hint > p:first-child {
  padding-top: 1rem;
}

.hint > p:last-child {
  padding-bottom: 1rem;
}

.hint h1, .hint h2, .hint h3, .hint h4 {
  margin: 0;
  padding: 12px 18px;
  border: 0;
  background: rgba(139, 92, 246, 0.14);
  font-size: 1rem;
  font-weight: 700;
}

.hint-info {
  border-left-color: var(--info);
}

.hint-success {
  border-left-color: var(--success);
  background: #202822;
}

html[data-theme="light"] .hint-success {
  background: #e7f4ec;
}

.hint-success h1, .hint-success h2, .hint-success h3, .hint-success h4 {
  background: rgba(32, 200, 117, 0.16);
}

.hint-warning {
  border-left-color: var(--warning);
  background: #28241e;
}

.hint-warning h1, .hint-warning h2, .hint-warning h3, .hint-warning h4 {
  background: rgba(245, 158, 11, 0.16);
}

.hint-danger {
  border-left-color: var(--danger);
  background: #2a1f1f;
}

/* Code & Tables */
pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101010;
}

html[data-theme="light"] pre {
  border-color: #d4dbe4;
  background: #eef1f5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

p code, li code {
  padding: 0.2rem 0.4rem;
  border-radius: 5px;
  background: #2a2a2a;
  font-size: 0.9em;
}

html[data-theme="light"] p code, html[data-theme="light"] li code {
  background: #e7ebf1;
}

table {
  width: 100%;
  margin: 1.6rem 0;
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 1px 300px;
  border: 1px solid var(--line);
}

th, td {
  padding: 11px 16px;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.55;
}

th {
  background: var(--surface-2);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

html[data-theme="light"] th {
  color: #0f172a;
}

tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   Caixas de Seleção e Controles de Formulário Modernos
   ========================================================================== */

select,
.calc-input,
.type-select,
.input-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  width: 100%;
  height: 42px;
  padding: 0 40px 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 40px;
  color: #f1f5f9;
  background-color: var(--surface-1, #1e1e1e);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234c91ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  border: 1.5px solid var(--line, #3a3a3a);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}

html[data-theme="light"] select,
html[data-theme="light"] .calc-input,
html[data-theme="light"] .type-select,
html[data-theme="light"] .input-select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

select:hover,
.calc-input:hover,
.type-select:hover {
  border-color: var(--accent);
  background-color: var(--surface-2, #262626);
  transform: translateY(-1px);
}

select:focus,
.calc-input:focus,
.type-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(76, 145, 255, 0.25)), 0 4px 14px rgba(76, 145, 255, 0.18);
}

select option {
  background-color: #1a1a1a;
  color: #f1f5f9;
  padding: 12px 16px;
  font-size: 14px;
}

html[data-theme="light"] select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* Inputs numéricos e texto em calculadoras */
input[type="number"].calc-input,
input[type="text"].calc-input {
  background-image: none;
  padding: 0 14px;
  line-height: normal;
}

/* Checkboxes estilizados */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  vertical-align: middle;
  border: 1.8px solid var(--line, #444);
  border-radius: 6px;
  background: var(--surface-1, #1e1e1e);
  cursor: pointer;
  transition: all 0.16s ease;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #ffffff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  background-color: #ffffff;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  box-shadow: 0 0 10px rgba(76, 145, 255, 0.35);
}

input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.article-meta svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Right Table of Contents (On this page)
   ========================================================================== */

.page-toc {
  grid-column: 3;
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  margin: 36px 24px 0 0;
  padding: 15px 0 15px 18px;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}

.page-toc[hidden] {
  display: none;
}

.page-toc-title {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.page-toc nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-toc a {
  display: block;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  transition: all 0.14s ease;
}

.page-toc a:hover,
.page-toc a.is-active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.page-toc .toc-depth-3 {
  padding-left: 18px;
  font-size: 12px;
}

/* ==========================================================================
   Back to top Button
   ========================================================================== */

.back-to-top {
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  transform: translateY(14px) scale(0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(32, 32, 32, 0.92);
  color: var(--text);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.18s ease;
}

.back-to-top.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
  background: #292929;
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .page-toc {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
  }
  .brand {
    display: none;
  }
  .menu-button {
    display: block;
  }
  .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }
  .search-wrap kbd {
    display: none;
  }
  .search-wrap input {
    padding-right: 14px;
    font-size: 13px;
  }
  .layout {
    display: block;
  }
  #sidebar {
    z-index: 90;
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
  }
  body.menu-open {
    overflow: hidden;
  }
  body.menu-open #sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  body.menu-open .sidebar-backdrop {
    display: block;
    opacity: 1;
  }
  main {
    padding: 32px 18px 70px;
  }
  h1 {
    font-size: 2rem;
  }
  .search-results {
    position: fixed;
    top: 58px;
    left: 10px;
    right: 10px;
  }
}

/* ==========================================================================
   Breadcrumbs (Migalhas de Navegação Estrutural)
   ========================================================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs-separator {
  display: inline-flex;
  color: var(--muted);
  opacity: 0.6;
  font-size: 11px;
  user-select: none;
}

.breadcrumbs-current {
  color: var(--text);
  font-weight: 600;
}

/* ==========================================================================
   Heading Permalinks (# Âncoras em Cabeçalhos)
   ========================================================================== */

article h2, article h3 {
  position: relative;
}

.heading-anchor {
  position: absolute;
  left: -26px;
  padding: 0 4px;
  color: var(--muted);
  font-weight: 400;
  opacity: 0;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
  user-select: none;
}

article h2:hover .heading-anchor,
article h3:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 0.85;
}

.heading-anchor:hover {
  color: var(--accent);
  opacity: 1;
}

.heading-anchor-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 8px 16px;
  border-radius: 8px;
  background: #20c875;
  color: #0b291a;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 150;
}

.heading-anchor-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .heading-anchor {
    position: static;
    margin-left: 6px;
    opacity: 0.5;
  }
}

/* ==========================================================================
   Page Pagination (Navegação Sequencial Anterior / Próximo)
   ========================================================================== */

.page-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 48px 0 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-pagination-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-1);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.page-pagination-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

html[data-theme="light"] .page-pagination-link:hover {
  box-shadow: 0 6px 20px rgba(27, 39, 55, 0.08);
}

.page-pagination-next {
  text-align: right;
  grid-column: 2;
}

.page-pagination-prev {
  text-align: left;
  grid-column: 1;
}

.page-pagination-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.page-pagination-next .page-pagination-label {
  justify-content: flex-end;
}

.page-pagination-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.page-pagination-link:hover .page-pagination-title {
  color: var(--accent);
}

@media (max-width: 680px) {
  .page-pagination {
    grid-template-columns: 1fr;
  }
  .page-pagination-next {
    grid-column: 1;
    text-align: left;
  }
  .page-pagination-next .page-pagination-label {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Botões de Cópia Rápida de Comandos e Códigos
   ========================================================================== */

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 5;
}

.code-copy-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--accent);
}

.code-copy-btn.copied {
  background: rgba(32, 200, 117, 0.18);
  border-color: #20c875;
  color: #20c875;
}

.interactive-cmd {
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.interactive-cmd:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
}

.interactive-cmd:active {
  transform: scale(0.98);
}

.interactive-cmd.cmd-copied {
  background: rgba(32, 200, 117, 0.22) !important;
  color: #20c875 !important;
  border: 1px solid #20c875 !important;
}

/* ==========================================================================
   Badges Elementais de Pokémon (Tipos Oficiais Cobblemon)
   ========================================================================== */

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.type-normal   { background: #9fa19f; }
.type-fire     { background: #e62829; }
.type-water    { background: #2980ef; }
.type-grass    { background: #3fa129; }
.type-electric { background: #fac000; color: #1a1a1a; text-shadow: none; }
.type-ice      { background: #3dcef3; color: #111827; text-shadow: none; }
.type-fighting { background: #ff8000; }
.type-poison   { background: #9141cb; }
.type-ground   { background: #915121; }
.type-flying   { background: #81b9ef; color: #111827; text-shadow: none; }
.type-psychic  { background: #ef4179; }
.type-bug      { background: #91a119; }
.type-rock     { background: #afa981; }
.type-ghost    { background: #704170; }
.type-dragon   { background: #5060e1; }
.type-dark     { background: #50413f; }
.type-steel    { background: #60a1b8; }
.type-fairy    { background: #ef70ef; }

/* Multiplicadores de Dano */
.mult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.mult-4x      { background: #ef4444; color: #fff; }
.mult-2x      { background: #f97316; color: #fff; }
.mult-1x      { background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); }
.mult-half    { background: #10b981; color: #fff; }
.mult-quarter { background: #059669; color: #fff; }
.mult-0x      { background: #312e81; color: #a5b4fc; border: 1px solid #4f46e5; }

/* ==========================================================================
   Container de Iframes e Ferramentas Incorporadas (Showdown Calc)
   ========================================================================== */

.embed-frame-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.embed-frame-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 700;
}

.embed-frame-actions {
  display: flex;
  gap: 8px;
}

.embed-frame-btn {
  padding: 6px 13px;
  border-radius: 7px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.embed-frame-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.showdown-iframe {
  width: 100%;
  height: 900px;
  border: none;
  background: #ffffff;
  display: block;
}

/* ==========================================================================
   Botão de Ferramentas na Barra Superior & Aba de Ferramentas
   ========================================================================== */

.topbar-tools-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.topbar-tools-link:hover, .topbar-tools-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 860px) {
  .topbar-tools-link .text {
    display: none;
  }
  .topbar-tools-link {
    padding: 6px 10px;
  }
}

/* Sistema de Abas de Ferramentas */
.tools-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 26px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
}

.tool-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-tab-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}

.tool-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(76, 145, 255, 0.35);
}

.tool-tab-pane {
  display: none;
}

.tool-tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Barras de Atributos do Simulador de Stats */
.stat-row {
  display: grid;
  grid-template-columns: 85px 50px 1fr 50px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.stat-label {
  font-weight: 800;
  text-transform: uppercase;
}
.stat-val {
  font-weight: 900;
  font-size: 14.5px;
  color: var(--accent);
  text-align: right;
}
.stat-bar-track {
  height: 9px;
  background: var(--surface-3);
  border-radius: 5px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--accent), #20c875);
}



/* ==========================================================================
   Calculadora de Dano Competitiva Nativa (Gen IX / Cobblemon)
   ========================================================================== */

.damage-calc-wrapper {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.calc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.calc-title-area h3 {
  margin: 4px 0 0 0;
  font-size: 18.5px;
  font-weight: 800;
  color: var(--text);
}

.calc-engine-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(76, 145, 255, 0.15);
  color: var(--accent);
}

.calc-quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.calc-format-toggle {
  display: inline-flex;
  gap: 14px;
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.calc-format-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
}

.btn-calc-swap,
.btn-calc-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-calc-swap {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-calc-swap:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-calc-reset {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.btn-calc-reset:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Painel de Resultados */
.calc-result-dashboard {
  background: linear-gradient(135deg, rgba(76, 145, 255, 0.08) 0%, rgba(32, 200, 117, 0.05) 100%);
  border: 1px solid rgba(76, 145, 255, 0.28);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 24px;
}

.result-formula-header {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.result-percentage-display {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.result-main-pct {
  font-size: 34px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.result-rolls-summary {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
}

.result-verdict-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 16px;
}

.result-verdict-banner.ko-guaranteed {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.result-verdict-banner.ko-chance {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.result-verdict-banner.ko-2hko {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.result-verdict-banner.ko-likely-2hko {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.result-verdict-banner.ko-3hko,
.result-verdict-banner.ko-safe {
  background: rgba(32, 200, 117, 0.18);
  color: #34d399;
  border: 1px solid rgba(32, 200, 117, 0.35);
}

.calc-hp-visualizer {
  margin: 14px 0 16px;
}

.calc-hp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.calc-hp-track {
  height: 14px;
  background: var(--surface-3);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.calc-hp-fill {
  height: 100%;
  border-radius: 7px;
  background: #20c875;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.calc-rolls-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.calc-rolls-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-rolls-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roll-chip {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  padding: 4px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  user-select: all;
}

.calc-multipliers-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.calc-tag {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.tag-se {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-res {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-immune {
  background: rgba(156, 163, 175, 0.18);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.tag-stab {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.tag-crit {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-item,
.tag-field,
.tag-screen {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}

/* Arena Grid (3 Colunas) */
.calc-arena-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

@media (max-width: 1050px) {
  .calc-arena-grid {
    grid-template-columns: 1fr;
  }
}

.calc-side-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.header-icon {
  font-size: 24px;
}

.header-title strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.header-title small {
  font-size: 11.5px;
  color: var(--muted);
}

.calc-control-group {
  margin-bottom: 12px;
}

.calc-control-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.calc-select,
.calc-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  box-sizing: border-box;
}

.calc-select:focus,
.calc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(76, 145, 255, 0.2);
}

.calc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.calc-divider {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 14px 0;
}

.calc-stats-box {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
}

.stats-box-title {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.calc-stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.calc-stat-table th {
  text-align: left;
  padding: 4px 6px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.calc-stat-table td {
  padding: 6px 4px;
}

.calc-stat-input {
  width: 44px;
  padding: 4px 5px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  box-sizing: border-box;
}

.calc-stage-select {
  width: 52px;
  padding: 4px 4px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-sizing: border-box;
}

.total-stat-val {
  font-weight: 900;
  color: var(--accent);
  text-align: right;
  font-size: 13px;
}

/* ==========================================================================
   Simulador de Status Avançado (Bulbapedia Pokédex + Autocomplete)
   ========================================================================== */

.pokedex-search-area {
  margin-bottom: 20px;
}

.search-field-label {
  display: block;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 8px;
}

.pokedex-search-input-wrap {
  position: relative;
  width: 100%;
}

.pokedex-search-input {
  width: 100%;
  padding: 12px 42px 12px 16px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  color: var(--text);
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.pokedex-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 145, 255, 0.25);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.pokedex-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: 0;
}

.autocomplete-item:hover {
  background: rgba(76, 145, 255, 0.12);
}

.autocomplete-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
}

.item-details strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.item-num {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-left: 4px;
}

.item-details small {
  color: var(--muted);
  font-size: 12px;
}

/* Card de Perfil do Pokémon */
.pokemon-profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.profile-sprite-wrap {
  width: 90px;
  height: 90px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-sprite-wrap img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
}

.profile-info {
  flex: 1;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.profile-badge-num {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
}

.profile-title-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.profile-types-wrap {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

/* Presets Toolbar */
.presets-toolbar {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

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

.presets-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  min-width: 110px;
}

.presets-chips-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}

.preset-reset {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.preset-reset:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
}

/* Orçamento de EVs */
.ev-budget-container {
  margin-top: 18px;
}

.ev-budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.badge-budget {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-budget-ok {
  background: rgba(32, 200, 117, 0.18);
  color: #20c875;
}

.badge-budget-exceeded {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Tabela dos Atributos */
.sim-stat-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 13px;
}

.sim-stat-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.sim-stat-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.base-stat-pill {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 800;
  font-size: 13px;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text);
}

.calc-mini-input {
  width: 54px;
  padding: 6px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  text-align: center;
  font-weight: 700;
}

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

.ev-range {
  flex: 1;
  max-width: 130px;
}

.ev-number-input {
  width: 58px;
}

.final-stat-val {
  font-size: 18px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.stat-mini-bar-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
  width: 100%;
}

.stat-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.25s ease;
}
