/* DrenoxBot design system: tokens, type, controls. Shared by every page.
   Deliberately single-theme (dark): the brand lives on obsidian, and so does the game.
   Square corners, hairlines, one accent (cyan). HP red / mana blue are Tibia's own semantics. */
/* Self-hosted (latin subset) — no third-party font CDN, so font-src can stay 'self'.
   Portuguese text lives entirely in U+0000-00FF, which the latin subset covers. */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 600 900; font-stretch: 100% 125%;
  font-display: swap; src: url('/fonts/archivo-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-stretch: 100%;
  font-display: swap; src: url('/fonts/ibmplexsans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/fonts/ibmplexmono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('/fonts/ibmplexmono-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/fonts/ibmplexmono-600-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ink: #070B14;
  --ink-2: #0A101D;
  --panel: #0E1524;
  --panel-2: #131C2F;
  --line: #1C2740;
  --line-2: #2A3856;
  --text: #EEF2FA;
  --muted: #8B98AF;
  --dim: #5A6781;
  --cyan: #23D5FF;
  --cyan-ink: #04202A;
  --violet: #7B4DFF;
  --hp: #E0463B;
  --mana: #3B6CFF;
  --ok: #37C978;
  --warn: #E8B63E;

  --display: 'Archivo', 'Arial Black', 'Helvetica Neue', sans-serif;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;

  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 3.6vw, 2.75rem);
  --step-4: clamp(2.5rem, 6.2vw, 4.75rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  background: var(--ink); color: var(--text);
  font: 400 var(--step-0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--cyan); color: var(--ink); }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; font-stretch: 112%; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
/* Small phones (320–400px): the wide uppercase display face needs a smaller scale to fit long words. */
@media (max-width: 400px) { :root { --step-4: 2.15rem; --step-3: 1.7rem; --step-2: 1.45rem; } }
p { text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Label in the style of the bot's own panel headers ("Session", "Battle (6)"). */
.tag {
  display: inline-block; font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 6px 9px; border: 1px solid var(--line-2); background: var(--ink-2);
}
.tag.accent { color: var(--cyan); border-color: rgba(35, 213, 255, .35); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 0;
  background: transparent; color: var(--text);
  font: 700 .82rem/1 var(--display); font-stretch: 118%; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { border-color: var(--text); color: var(--text); }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: var(--cyan-ink); }
.btn.primary:hover { background: var(--text); border-color: var(--text); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .72rem; }
.btn.danger:hover { border-color: var(--hp); color: var(--hp); }
.btn:disabled { opacity: .45; cursor: default; }
.btn .k { font-family: var(--mono); font-weight: 500; letter-spacing: 0; text-transform: none; }

.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--text); }

/* ---- form controls ---- */
.field { display: grid; gap: 6px; }
.field > span { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.control {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 0;
  background: var(--ink); color: var(--text); font: 400 .95rem/1.4 var(--sans);
}
.control:focus { outline: none; border-color: var(--cyan); }
textarea.control { min-height: 120px; resize: vertical; }
textarea.control.code { font-family: var(--mono); font-size: .85rem; line-height: 1.5; }
select.control { appearance: none; padding-right: 32px;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B98AF'/%3E%3C/svg%3E") right 12px center no-repeat; }
.error { color: var(--hp); font-size: var(--step--1); min-height: 1.3em; }

/* ---- nav ---- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(7, 11, 20, .96); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav-logo { flex-shrink: 0; }
.nav-logo img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .btn { color: var(--cyan-ink); }
.nav-links .linklike { color: var(--muted); font-size: .9rem; text-decoration: none; }
.nav-links .linklike:hover { color: var(--text); }
.nav-menu { display: none; margin-left: auto; }
/* Dropdown (<details>): a panel under the item on desktop, an inline sub-list in the mobile menu. */
.nav-drop details { position: relative; }
.nav-drop summary { list-style: none; cursor: pointer; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nav-drop details[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-drop summary:hover, .nav-drop summary[aria-current="page"], .nav-drop details[open] summary { color: var(--text); }
.nav-drop ul { list-style: none; position: absolute; top: calc(100% + 22px); left: -16px; min-width: 190px; padding: 6px 0;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.nav-drop ul a { display: block; padding: 9px 16px; }
.nav-drop ul a:hover { background: var(--panel-2); }

@media (max-width: 880px) {
  .nav-menu { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
    /* The header is sticky: a menu taller than the screen scrolls inside itself. */
    max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links a:not(.btn) { display: block; padding: 14px 0; }
  .nav-links li:last-child { border: 0; padding-top: 16px; }
  .nav-links .btn { width: 100%; }
  .nav-drop summary { padding: 14px 0; }
  .nav-drop ul { position: static; min-width: 0; padding: 0 0 8px 14px; background: none; border: 0; box-shadow: none; }
  .nav-drop ul li, .nav-links .nav-drop ul li:last-child { border: 0; padding-top: 0; }
  .nav-drop ul a:not(.btn) { padding: 10px 0; }
  .nav-drop ul a:hover { background: none; }
}

/* Language switch (PT | EN): the current language in cyan, a hairline between the two. */
.lang-switch { display: flex; align-items: center; }
.nav-links .lang-switch a { display: inline-block; padding: 2px 8px; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav-links .lang-switch a:first-child { padding-left: 0; }
.nav-links .lang-switch a + a { border-left: 1px solid var(--line-2); }
.nav-links .lang-switch a:hover { color: var(--text); }
.nav-links .lang-switch a[aria-current="true"] { color: var(--cyan); }
@media (max-width: 880px) { .nav-links .lang-switch a { padding-block: 14px; } }
/* Just above the menu breakpoint the home nav (12 items with the switch) is tight: close it up. */
@media (min-width: 881px) and (max-width: 1100px) { .nav-links { gap: 14px; } .nav-links a, .nav-links .linklike { font-size: .85rem; } }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); padding-block: 40px; color: var(--dim); font-size: var(--step--1); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.footer img { height: 20px; width: auto; opacity: .8; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---- modal and toast (community, admin) ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 10, .82); }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line-2); padding: 28px; display: grid; gap: 16px; }
.modal h3 { font-size: var(--step-1); text-transform: uppercase; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.modal-actions .spacer { margin-right: auto; }

.toast { position: fixed; right: 16px; bottom: 16px; z-index: 90; max-width: min(420px, calc(100% - 32px));
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok);
  padding: 12px 16px; font-size: .9rem; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--hp); }

/* ---- chips (status, kind, tier) ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid var(--line-2);
  font: 500 .7rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: rgba(55, 201, 120, .4); }
.chip.warn { color: var(--warn); border-color: rgba(232, 182, 62, .4); }
.chip.bad { color: var(--hp); border-color: rgba(224, 70, 59, .45); }
.chip.cyan { color: var(--cyan); border-color: rgba(35, 213, 255, .4); }
.chip.violet { color: #A58BFF; border-color: rgba(123, 77, 255, .5); }
.dot { width: 7px; height: 7px; background: var(--ok); display: inline-block; }
.dot.off { background: var(--dim); }

/* ---- cookie notice (js/ga.js) ---- */
.cookies { position: fixed; left: 16px; bottom: 16px; z-index: 85; max-width: min(460px, calc(100% - 32px));
  display: grid; gap: 12px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--cyan); font-size: .9rem; }
.cookies p { margin: 0; color: var(--muted); }
.cookies-actions { display: flex; gap: 10px; justify-content: flex-end; }
.footer .linklike { color: var(--muted); text-decoration: none; }
