/* ==========================================================================
   AION 2 TRACKER AND GUIDE — styles.css
   Tema dark minimalista: componentes flat, raio discreto (4px), sem glow,
   uma única família tipográfica (Rajdhani).

   Índice
     1. Tokens
     2. Base, fundo & utilitários
     3. Botões, inputs, switches, checkboxes
     4. Ícones de classe, iniciais de conta, rank & tooltips
     5. Ecrã de autenticação
     6. Header, tabs, timers, banner admin
     7. Painéis & estados vazios
     8. Tabela de personagens (Account + Global)
     9. Cartões mobile
    10. Guide — lojas & prioridades
    11. Modal & formulários
    12. Toasts
    13. Animações
    14. Responsivo
   ========================================================================== */


/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
  color-scheme: dark;

  /* Superfícies (opacas: necessário para as colunas sticky da tabela) */
  --bg-0: #05080e;
  --surface: #0d131f;
  --surface-2: #121a29;
  --surface-3: #182234;
  --input: #090e18;
  --line: rgba(150, 170, 210, 0.12);
  --line-2: rgba(150, 170, 210, 0.22);
  --line-3: rgba(150, 170, 210, 0.36);

  /* Texto */
  --text: #e6ebf3;
  --text-2: #a7b1c5;
  --text-3: #707c94;

  /* Acentos */
  --gold: #d6b46c;
  --gold-hover: #e3c586;
  --accent: #6fb3d6;

  /* Categorias de tarefas (tons suaves) */
  --daily: #8fbc8f;    /* Dark Sea Green */
  --weekly: #c48a99;   /* Dusty Rose */
  --other: #c9a66b;    /* Âmbar suave (categoria Other) */

  --ok: #7fc4a4;
  --danger: #d9787a;

  /* Roles */
  --role-tank: #86a9d6;
  --role-healer: #8cc3a6;
  --role-dps: #d39282;

  /* Prioridades do Guide */
  --prio-1: #6fa8e8;   /* Diamond — azul */
  --prio-2: #5fc48f;   /* Emerald — verde */
  --prio-3: #d4b24f;   /* Gold — amarelo */
  --prio-4: #a2aab4;   /* Silver — cinza */
  --prio-5: #b97d50;   /* Bronze */

  /* Eventos */
  --ev-boss: #d9787a;
  --ev-festival: #d6b46c;
  --ev-other: #6fb3d6;

  /* Layout — uma só largura/gutter para header, conteúdo e rodapé */
  --container: 1680px;
  --gutter: 24px;

  /* Forma & tipografia — uma só família em todo o site */
  --radius: 4px;
  --font: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --check-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0f18' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --chevron-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7b1c5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}


/* ==========================================================================
   2. BASE, FUNDO & UTILITÁRIOS
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Reserva sempre o espaço da scrollbar: o layout (e o logo) não salta ao trocar de tab */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  font: 500 17px/1.45 var(--font);
  color: var(--text);
  background: var(--bg-0);
  overflow-x: hidden;
}

/* Fundo global: imagem fixa, desfocada, com overlay escuro para legibilidade */
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}
body::before {
  inset: -80px;   /* margem para o blur não deixar bordas claras */
  z-index: -2;
  background: url("assets/background/background-main.png") center / cover no-repeat;
  filter: blur(28px) saturate(0.85);
}
body::after {
  inset: 0;
  z-index: -1;
  background: rgba(4, 7, 13, 0.84);
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label-ui {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}


/* ==========================================================================
   3. BOTÕES, INPUTS, SWITCHES, CHECKBOXES
   ========================================================================== */
.btn {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--text);
  --btn-bd: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn .ic { width: 17px; height: 17px; stroke-width: 2.2; }
.btn:hover { --btn-bg: var(--surface-2); border-color: var(--line-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-gold { --btn-bg: var(--gold); --btn-fg: #14100a; --btn-bd: var(--gold); }
.btn-gold:hover { --btn-bg: var(--gold-hover); border-color: var(--gold-hover); }

.btn-outline { --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--line-3); }
.btn-outline:hover { --btn-bg: rgba(255, 255, 255, 0.05); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.05); --btn-fg: var(--text); }

.btn-danger { --btn-bg: var(--danger); --btn-fg: #1a0707; --btn-bd: var(--danger); }
.btn-danger:hover { --btn-bg: #e38c8e; }

.btn-danger-text { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-danger-text:hover { --btn-bg: rgba(217, 120, 122, 0.12); border-color: transparent; }

.btn-dashed { --btn-bg: transparent; --btn-fg: var(--text-2); width: 100%; border-style: dashed; }
.btn-dashed:hover { --btn-bg: rgba(255, 255, 255, 0.04); --btn-fg: var(--text); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 46px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius);
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { opacity: 0.28; cursor: not-allowed; background: transparent; }
.icon-btn--danger:hover { color: var(--danger); background: rgba(217, 120, 122, 0.12); }
.icon-btn--sm { width: 28px; height: 28px; }
.icon-btn--sm .ic { width: 16px; height: 16px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label,
.field > legend {
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.field > legend { margin-bottom: 7px; }
.field-hint { font-size: 14px; color: var(--text-3); }

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--input);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s;
}
.input::placeholder { color: var(--text-3); opacity: 0.7; font-weight: 500; }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: var(--accent); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: var(--chevron-img);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
select.input optgroup,
select.input option { background: var(--surface); color: var(--text); }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  transition: background-color 0.2s, border-color 0.2s;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.switch input:checked + .switch-track { background: var(--gold); border-color: var(--gold); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: #14100a; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}
.switch-label .ic { width: 16px; height: 16px; }
.switch input:checked ~ .switch-label { color: var(--gold); }

/* Checkbox — herda --c do contexto (Daily / Weekly / War) */
.check {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 21px;
  height: 21px;
  margin: 0;
  border-radius: 3px;
  border: 1.5px solid var(--line-3);
  background: transparent var(--check-img) center / 0 0 no-repeat;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color 0.15s, background-size 0.15s var(--ease), border-color 0.15s;
}
.check:hover:not(:disabled) { border-color: var(--c, var(--accent)); }
.check:checked {
  border-color: var(--c, var(--accent));
  background-color: var(--c, var(--accent));
  background-size: 14px 14px;
}
.check:disabled { cursor: default; }


/* ==========================================================================
   4. ÍCONES DE CLASSE, INICIAIS DE CONTA, RANK & TOOLTIPS
   ========================================================================== */
.role-tank   { --role-c: var(--role-tank); }
.role-healer { --role-c: var(--role-healer); }
.role-dps    { --role-c: var(--role-dps); }

.class-icon {
  --s: 36px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  border-radius: var(--radius);
  background: var(--input);
  border: 1px solid var(--line);
  overflow: hidden;
}
.class-icon--sm { --s: 34px; }
.class-icon--lg { --s: 52px; }
.class-icon img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.class-icon-fallback {
  font-size: calc(var(--s) * 0.38);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--role-c);
}
.class-icon.has-img .class-icon-fallback { opacity: 0; }

/* Quadrado com as iniciais da conta (cor do jogador em --pc) */
.acc-square {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  background: var(--pc, var(--accent));
  color: var(--pc-fg, #0b0f18);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crown { display: inline-flex; color: var(--gold); }
.crown .ic { width: 17px; height: 17px; stroke-width: 2; }

.rank {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
}
/* Cores só nas prioridades do Guide */
.rank-1 { background: var(--prio-1); color: #0b0f18; }
.rank-2 { background: var(--prio-2); color: #0b0f18; }
.rank-3 { background: var(--prio-3); color: #0b0f18; }
.rank-4 { background: var(--prio-4); color: #0b0f18; }
.rank-5 { background: var(--prio-5); color: #0b0f18; }

.scope-tag {
  flex: none;
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
}
.scope-server { color: #d8a3a3; }
/* Etiqueta Serv/Char por baixo do nome da tarefa no cabeçalho da tabela */
.scope-tag.th-scope { display: table; margin: 7px auto 0; font-size: 10px; letter-spacing: 0.08em; color: inherit; background: rgba(255, 255, 255, 0.06); }
.scope-character { color: #a3cdb7; }

/* Tooltip (hover / foco) */
.tip { position: relative; cursor: help; border-bottom: 1px dotted var(--text-3); }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: var(--radius);
  background: var(--text);
  color: #0b0f18;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.tip:hover::after,
.tip:focus::after { opacity: 1; }


/* ==========================================================================
   5. ECRÃ DE AUTENTICAÇÃO
   ========================================================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  padding: 24px 16px;
  overflow-y: auto;
  /* Efeito sobre a imagem — apenas tons de azul */
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(90, 150, 255, 0.2), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(60, 170, 235, 0.16), transparent 70%),
    linear-gradient(rgba(3, 8, 22, 0.6), rgba(3, 8, 22, 0.6)),
    url("assets/background/background-main.png") center / cover no-repeat,
    #040a18;
}

.auth-motes { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.auth-motes span {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9cc8ff;
  box-shadow: 0 0 10px 2px rgba(90, 160, 255, 0.55);
  opacity: 0;
  animation: mote 14s linear infinite;
}
.auth-motes span:nth-child(3n) { background: #7fdcff; box-shadow: 0 0 10px 2px rgba(70, 190, 240, 0.55); }
.auth-motes span:nth-child(1)  { left: 6%;  animation-delay: 0s;  animation-duration: 15s; }
.auth-motes span:nth-child(2)  { left: 14%; animation-delay: 4s;  animation-duration: 12s; }
.auth-motes span:nth-child(3)  { left: 22%; animation-delay: 8s;  animation-duration: 17s; }
.auth-motes span:nth-child(4)  { left: 31%; animation-delay: 2s;  animation-duration: 13s; }
.auth-motes span:nth-child(5)  { left: 40%; animation-delay: 10s; animation-duration: 16s; }
.auth-motes span:nth-child(6)  { left: 52%; animation-delay: 6s;  animation-duration: 12s; }
.auth-motes span:nth-child(7)  { left: 61%; animation-delay: 1s;  animation-duration: 18s; }
.auth-motes span:nth-child(8)  { left: 70%; animation-delay: 9s;  animation-duration: 14s; }
.auth-motes span:nth-child(9)  { left: 78%; animation-delay: 3s;  animation-duration: 15s; }
.auth-motes span:nth-child(10) { left: 86%; animation-delay: 7s;  animation-duration: 13s; }
.auth-motes span:nth-child(11) { left: 93%; animation-delay: 11s; animation-duration: 16s; }
.auth-motes span:nth-child(12) { left: 47%; animation-delay: 13s; animation-duration: 19s; }

.auth-card {
  position: relative;
  width: min(410px, 100%);
  margin: auto;
  padding: 28px 26px 22px;
  border-radius: 6px;
  background: rgba(7, 13, 26, 0.86);
  border: 1px solid rgba(120, 160, 230, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: rise 0.5s var(--ease) both;
}

.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { display: block; width: 150px; height: auto; margin: 0 auto 10px; }
.auth-brand .brand-title { font-size: 22px; }
.auth-brand .brand-sub { margin-top: 6px; }

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.auth-switch button {
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.auth-switch button:hover { color: var(--text); }
.auth-switch button[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.auth-form { display: grid; gap: 16px; margin-top: 20px; }

.auth-warning {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(217, 120, 122, 0.1);
  border-left: 3px solid var(--danger);
  color: #f0c8c8;
  font-size: 15px;
  line-height: 1.4;
}
.auth-warning .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--danger); }
.auth-warning strong { color: #fde2e2; }

.auth-hint { margin-top: 18px; text-align: center; font-size: 14px; line-height: 2; color: var(--text-3); }
.auth-hint code {
  padding: 1px 5px;
  border-radius: 3px;
  font: 600 12px/1 ui-monospace, Consolas, monospace;
  color: #a9cdf2;
  background: rgba(120, 170, 240, 0.1);
}

.form-error { color: var(--danger); font-size: 15px; }
.form-error:empty { display: none; }


/* ==========================================================================
   6. HEADER, TABS, TIMERS, BANNER ADMIN
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 15, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* Usa a mesma .container que o conteúdo e o rodapé (largura/gutter idênticos) */
.topbar-inner {
  padding-block: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "brand tabs timers actions";
  align-items: center;
  gap: 10px 20px;
}

.brand { grid-area: brand; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo { display: block; width: auto; height: 52px; }
.brand-title {
  font-size: 20px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-sub {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

.tabs { grid-area: tabs; justify-self: center; display: flex; gap: 2px; }
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.tab .ic { width: 17px; height: 17px; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab[aria-selected="true"] { color: var(--gold); background: rgba(255, 255, 255, 0.07); }

.timers { grid-area: timers; display: flex; gap: 6px; }
.timer {
  --c: var(--daily);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-2);
}
.timer .ic { width: 15px; height: 15px; color: var(--c); }
.timer b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.timer-label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.timer--weekly { --c: var(--weekly); }

.topbar-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: var(--radius);
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background-color 0.15s;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.09); }
.user-chip .acc-square { width: 28px; height: 28px; font-size: 13px; }
.user-chip-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-banner { background: rgba(214, 180, 108, 0.08); border-bottom: 1px solid rgba(214, 180, 108, 0.25); }
.admin-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-block: 10px;
}
.admin-banner p { display: flex; align-items: flex-start; gap: 8px; font-size: 16px; color: var(--gold); }
.admin-banner p .ic { width: 18px; height: 18px; margin-top: 2px; }
.admin-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }


/* ==========================================================================
   7. PAINÉIS & ESTADOS VAZIOS
   ========================================================================== */
.main { padding-bottom: 56px; }

.app-footer {
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 30px 0 20px;
}
.panel-title {
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--gold);
}
.panel-sub { margin-top: 6px; font-size: 18px; color: var(--text-2); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.player-name { font-weight: 700; color: var(--pc, var(--text)); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 52px 24px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  background: rgba(13, 19, 31, 0.7);
}
.empty-state img { width: 110px; height: auto; opacity: 0.85; }
.empty-state h3 { font-size: 24px; font-weight: 700; letter-spacing: 0.04em; }
.empty-state p { max-width: 440px; color: var(--text-2); }
.empty-state .btn { margin-top: 6px; }


/* ==========================================================================
   8. TABELA DE PERSONAGENS (ACCOUNT + GLOBAL)
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.filter-group .label-ui { margin-right: 4px; }

.chip-toggle {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius);
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-3);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.chip-toggle .ic { width: 15px; height: 15px; }
.chip-toggle:hover { color: var(--text-2); }
.chip-toggle[aria-pressed="true"] { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }

.segmented { display: inline-flex; gap: 2px; }
.segmented button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.select-sm { width: auto; min-width: 150px; height: 34px; font-size: 15px; }

/* Cores por categoria */
.type-daily   { --c: var(--daily); }
.type-weekly  { --c: var(--weekly); }
.type-other   { --c: var(--other); }
.type-neutral { --c: var(--text-2); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.char-table {
  --acc-w: 58px;
  --rank-w: 0px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 18px;
}
.char-table--ranked { --rank-w: 54px; }

.char-table th,
.char-table td {
  padding: 12px 7px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  background-color: var(--row-bg, var(--surface));
}
.char-table thead th { --row-bg: #0a0f19; vertical-align: bottom; }
.char-table tbody tr:last-child > * { border-bottom: 0; }
.char-table tbody tr:hover { --row-bg: var(--surface-2); }
.th-label { font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }

/* Linha 1 do cabeçalho: grupos (Global/Account, Score, Daily, Weekly, War) */
.grp {
  padding: 11px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c);
}
.char-table thead .grp {
  --row-bg: color-mix(in srgb, var(--c) 10%, #0a0f19);
  vertical-align: middle;
  border-bottom-color: color-mix(in srgb, var(--c) 40%, transparent);
}
.char-table thead .grp.type-neutral { --row-bg: #0e1422; border-bottom-color: var(--line-2); }
.char-table thead .grp { white-space: nowrap; }
.grp .ic { width: 19px; height: 19px; margin: -3px 7px 0 0; }
.grp-lead { position: sticky; left: 0; z-index: 3; text-align: left !important; padding-left: 16px !important; box-shadow: 1px 0 0 var(--line); }

.col-task { width: 88px; min-width: 88px; }
th.col-task {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}
th.col-task .ic { display: block; width: 28px; height: 28px; margin: 0 auto 8px; color: var(--c); stroke-width: 1.6; }
.col-group-start { border-left: 1px solid var(--line-2); }
.col-task .check { width: 22px; height: 22px; }
.col-task .check:checked { background-size: 14px 14px; }

/* Colunas fixas (sticky) */
.col-acc,
.col-rank,
.col-char { position: sticky; z-index: 2; }
.col-acc  { left: 0; width: var(--acc-w); min-width: var(--acc-w); padding-left: 14px !important; }
.col-rank { left: var(--acc-w); width: var(--rank-w); min-width: var(--rank-w); }
.col-char {
  left: calc(var(--acc-w) + var(--rank-w));
  min-width: 280px;
  text-align: left !important;
  box-shadow: 1px 0 0 var(--line);
}
.char-table .acc-square { width: 36px; height: 36px; font-size: 16px; }
.char-table .rank { width: 34px; height: 34px; font-size: 17px; }
.char-table .class-icon--sm { --s: 42px; }

.col-stat { width: 84px; font-size: 21px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
th.col-stat { font-size: 15px; }
.col-stat.col-cs { color: var(--text-2); }
.col-stat.is-empty { color: var(--text-3); }

.cell-char { display: flex; align-items: center; gap: 12px; }
.cell-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.cell-name .crown .ic { width: 20px; height: 20px; }
.cell-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.cls-name { font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.lvl { font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: 0.06em; color: var(--text-3); }

.empty-row { padding: 40px 16px !important; color: var(--text-3); text-align: center; }

/* Botões de reset manual (tab Account) */
.reset-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }


/* ==========================================================================
   9. CARTÕES MOBILE (substituem a tabela em ecrãs pequenos)
   ========================================================================== */
.char-cards { display: none; gap: 10px; }
.c-card {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.c-head { display: flex; align-items: center; gap: 10px; }
.c-head .cell-name { font-size: 19px; }
.c-ident { min-width: 0; flex: 1; }
.c-stats { display: flex; gap: 14px; text-align: right; }
.c-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 19px; font-weight: 700; line-height: 1; }
.c-stat small { font-size: 11px; letter-spacing: 0.16em; color: var(--text-3); }
.c-stat--cs { color: var(--text-2); }
.c-section { margin-top: 12px; }
.c-section-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
}
.c-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.c-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.c-chip .ic { width: 17px; height: 17px; }
.c-chip.is-done { color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
label.c-chip { cursor: pointer; }
label.c-chip:hover { color: var(--text-2); }
label.c-chip.is-done:hover { color: var(--c); }
.c-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }


/* ==========================================================================
   10. SHOP — LOJAS & PRIORIDADES
   ========================================================================== */
.guide-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 18px; font-size: 16px; color: var(--text-2); }
.guide-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.guide-legend .rank { width: 26px; height: 26px; font-size: 14px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.shop-grid.is-admin { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.shop-name { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: 0.02em; }
.shop-meta { font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }

/* Item numa só linha: rank · nome · qty · preço · (ações admin) */
.prio-cols,
.prio-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 44px 76px;
  align-items: center;
  gap: 12px;
}
.shop-grid.is-admin .prio-cols,
.shop-grid.is-admin .prio-item { grid-template-columns: 30px minmax(0, 1fr) 44px 76px auto; }
.prio-cols {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.prio-cols span:nth-child(3),
.prio-cols span:nth-child(4) { text-align: right; }
.shop-grid.is-admin .prio-cols span:nth-child(5) { width: 116px; }

.prio-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.prio-item {
  padding: 9px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.prio-name { min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.prio-qty,
.prio-price { text-align: right; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prio-qty { color: var(--text-2); }
.prio-price { color: var(--gold); }
.prio-qty.is-empty,
.prio-price.is-empty { color: var(--text-3); font-weight: 500; }
.prio-admin { display: flex; gap: 1px; }

.shop-empty {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  font-size: 16px;
  color: var(--text-3);
}

/* Modo Admin (Account Settings) */
.field-label { font-size: 13px; font-weight: 700; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.admin-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.btn-admin { min-width: 110px; }
.btn-admin.is-on { --btn-bg: var(--gold); --btn-fg: #14100a; --btn-bd: var(--gold); }
.admin-unlock { display: flex; gap: 8px; }
.admin-unlock .input { flex: 1; }


/* ==========================================================================
   10b. EVENTS — TIMERS DE SPAWN & DOCK FLUTUANTE
   ========================================================================== */
.ev-boss     { --c: var(--ev-boss); }
.ev-festival { --c: var(--ev-festival); }
.ev-other    { --c: var(--ev-other); }

.ev-table {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.ev-cols,
.ev-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 240px 130px 170px 120px;
  grid-template-areas: "icon main sched next countdown pin";
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
}
.ev-table.is-admin .ev-cols,
.ev-table.is-admin .ev-row {
  grid-template-columns: 46px minmax(0, 1fr) 240px 130px 170px 120px 64px;
  grid-template-areas: "icon main sched next countdown pin admin";
}
.ev-cols {
  padding-block: 12px;
  background: #0a0f19;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ev-list { margin: 0; padding: 0; list-style: none; }
.ev-row { border-bottom: 1px solid var(--line); transition: background-color 0.15s; }
.ev-row:last-child { border-bottom: 0; }
.ev-row:hover { background: var(--surface-2); }
.ev-row.is-live { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }

.ev-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.ev-icon .ic { width: 26px; height: 26px; }
.ev-main { grid-area: main; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-name { font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-type { font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c); }
.ev-schedule { grid-area: sched; font-size: 17px; color: var(--text-2); }
.ev-next { grid-area: next; font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ev-countdown { grid-area: countdown; font-size: 22px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-row.is-live .ev-countdown { text-transform: uppercase; letter-spacing: 0.1em; }
.btn-pin { grid-area: pin; justify-self: start; }
.btn-pin.is-on { --btn-bg: var(--gold); --btn-fg: #14100a; --btn-bd: var(--gold); }
.ev-admin { grid-area: admin; display: flex; gap: 2px; justify-content: flex-end; }

/* Dock flutuante (eventos com PIN) — canto inferior esquerdo, em todas as tabs */
.event-dock {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  width: 320px;
  max-width: calc(100vw - 40px);
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgba(13, 19, 31, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.dock-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.dock-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.dock-toggle .ic { width: 16px; height: 16px; }
.dock-toggle > .ic:last-child { margin-left: auto; }
.dock-toggle b { padding: 2px 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); color: var(--text); font-size: 13px; }
.dock-soonest { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.04em; color: var(--gold); }
.event-dock:not(.is-collapsed) .dock-toggle { border-bottom: 1px solid var(--line); }

.dock-list { display: grid; gap: 4px; max-height: min(50vh, 360px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.dock-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}
.dock-item:hover { background: rgba(255, 255, 255, 0.07); }
.dock-item.is-live { background: color-mix(in srgb, var(--c) 16%, transparent); }
.dock-item .ev-icon { grid-area: auto; width: 36px; height: 36px; }
.dock-item .ev-icon .ic { width: 20px; height: 20px; }
.dock-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dock-name { font-size: 16px; font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-type { font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c); }
/* Espaço extra no fim da página para o dock não tapar conteúdo */
.has-dock .app-footer { padding-bottom: 72px; }
.dock-time { font-size: 18px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap; }


/* ==========================================================================
   11. MODAL & FORMULÁRIOS
   ========================================================================== */
.modal {
  width: min(580px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}
.modal--wide { width: min(940px, calc(100vw - 32px)); }
.modal[open] { animation: modal-in 0.22s var(--ease); }
.modal::backdrop { background: rgba(3, 5, 10, 0.75); }

.modal-form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.modal-body { display: grid; gap: 18px; min-height: 0; padding: 20px; overflow-y: auto; }
.modal-form > .form-error { padding: 0 20px 12px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.modal-foot .foot-start { margin-right: auto; }
.modal-intro { color: var(--text-2); font-size: 16px; }
.confirm-msg { color: var(--text-2); font-size: 18px; line-height: 1.5; }
.confirm-msg strong { color: var(--text); }
.confirm-msg small { display: block; margin-top: 6px; font-size: 15px; color: var(--text-3); }

.form-row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 14px; }

/* Seletor de classe */
.class-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.class-group--dps { grid-column: 1 / -1; }
.class-group-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0.18em; text-transform: uppercase; color: var(--role-c); }
.class-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.class-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.class-tile input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.class-tile .class-icon { border: 0; background: transparent; }
.class-tile:hover { border-color: var(--line-3); }
.class-tile:has(input:checked) { color: var(--text); border-color: var(--role-c); background: color-mix(in srgb, var(--role-c) 10%, var(--input)); }
.class-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cores do jogador (cores já usadas por outras contas ficam bloqueadas) */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 8px; }
.swatch { position: relative; aspect-ratio: 1; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatch span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--sw);
  border: 2px solid transparent;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
.swatch span .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.swatch input:checked + span { border-color: var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch.is-taken,
.swatch.is-taken input { cursor: not-allowed; }
.swatch.is-taken span { opacity: 0.3; }

.settings-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--input);
}
.preview-row { display: flex; align-items: center; gap: 10px; }

/* Segmented radio */
.seg-radio { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--input); border: 1px solid var(--line-2); }
.seg-radio label { position: relative; flex: 1; }
.seg-radio input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-radio span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  pointer-events: none;
  transition: background-color 0.15s, color 0.15s;
}
.seg-radio span .ic { width: 15px; height: 15px; }
.seg-radio input:checked + span { color: var(--text); background: var(--surface-3); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Ícones */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-opt {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.icon-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.icon-opt .ic { width: 20px; height: 20px; pointer-events: none; }
.icon-opt:hover { color: var(--text); border-color: var(--line-3); }
.icon-opt:has(input:checked) { color: var(--gold); border-color: var(--gold); background: rgba(214, 180, 108, 0.1); }
.icon-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Gestor de tarefas */
.tm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tm-col { min-width: 0; padding: 10px; border-radius: var(--radius); background: var(--input); border-top: 2px solid var(--c); }
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tm-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
}
.tm-head h3 .ic { width: 16px; height: 16px; }
.tm-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tm-item { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 6px; border-radius: var(--radius); background: var(--surface-2); }
.tm-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 3px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tm-icon .ic { width: 15px; height: 15px; }
.tm-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-actions { display: flex; flex: none; }
.tm-empty { padding: 10px; font-size: 15px; color: var(--text-3); }


/* ==========================================================================
   12. TOASTS
   ========================================================================== */
.toasts {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 300;
  display: grid;
  gap: 8px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  overflow: visible;
  pointer-events: none;
}
.toasts:empty { display: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: min(400px, calc(100vw - 40px));
  padding: 11px 14px;
  border-radius: var(--radius);
  border-left: 3px solid var(--ok);
  background: var(--surface-3);
  font-size: 16px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.25s var(--ease);
}
.toast .ic { width: 17px; height: 17px; color: var(--ok); stroke-width: 2.2; }
.toast--error { border-left-color: var(--danger); }
.toast--error .ic { color: var(--danger); }
.toast--info { border-left-color: var(--gold); }
.toast--info .ic { color: var(--gold); }
.toast.is-leaving { animation: toast-out 0.3s ease forwards; }


/* ==========================================================================
   13. ANIMAÇÕES
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(16px); }
}
@keyframes mote {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  10%  { opacity: 0.9; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-105vh) scale(1.1); opacity: 0; }
}

/* Entrada apenas ao trocar de tab (não em cada re-render) */
.tab-panel.is-entering .panel-head,
.tab-panel.is-entering .filter-bar,
.tab-panel.is-entering .table-wrap,
.tab-panel.is-entering .c-card,
.tab-panel.is-entering .shop-card,
.tab-panel.is-entering .empty-state {
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .auth-motes { display: none; }
}


/* ==========================================================================
   14. RESPONSIVO
   ========================================================================== */
@media (max-width: 1360px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "brand timers actions"
      "tabs  tabs   tabs";
  }
  .timers { justify-self: end; }
  .tabs { justify-self: stretch; }
  .tab { flex: 1; }
}

@media (max-width: 900px) {
  .table-wrap { display: none; }
  .char-cards { display: grid; }
  .tm-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }

  .topbar { position: relative; }
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand  actions"
      "tabs   tabs"
      "timers timers";
  }
  .timers { justify-self: stretch; }
  .timer { flex: 1; justify-content: center; }
  .brand .brand-title { display: none; }
  .logo { height: 40px; }
  .tab { padding: 0 8px; gap: 6px; font-size: 14px; letter-spacing: 0.06em; }
  .tab .ic { display: none; }

  .panel-head { margin-top: 22px; }
  .panel-actions { width: 100%; }
  .panel-actions .btn,
  .reset-bar .btn { flex: 1 1 auto; }

  .form-row { grid-template-columns: minmax(0, 1fr); }
  .class-picker { grid-template-columns: minmax(0, 1fr); }
  .class-group-items { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }

  .filter-bar { gap: 12px; }
  /* No mobile os toasts vão para o topo para não taparem o dock de eventos */
  .toasts { inset: 12px 12px auto 12px; }
  .toast { max-width: none; }

  .ev-cols { display: none; }
  .ev-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon main      pin"
      "icon countdown countdown"
      "icon sched     sched";
    gap: 6px 12px;
    padding: 12px 14px;
    align-items: start;
  }
  .ev-table.is-admin .ev-row {
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "icon main      pin       admin"
      "icon countdown countdown countdown"
      "icon sched     sched     sched";
  }
  .ev-row .ev-icon { width: 40px; height: 40px; }
  .ev-name { font-size: 18px; }
  .ev-countdown { font-size: 20px; }
  .dock-list { max-height: 30vh; }
  .ev-next { display: none; }
  .ev-schedule { font-size: 14px; }

  .event-dock { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
  .has-dock .app-footer { padding-bottom: 260px; }
}

@media (max-width: 420px) {
  .user-chip { max-width: 110px; }
  .modal-body { padding: 16px; }
  .shop-grid { grid-template-columns: minmax(0, 1fr); }
  .c-stats { gap: 10px; }
}
