@import url("https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400;0,500;0,700;1,400&family=Alegreya+Sans+SC:wght@500;700&family=Alegreya+Sans:wght@400;500;700&family=Cinzel:wght@500;600;700&display=swap");

/* Grimório UI — componentes. Cores, espaços e raios vêm de tokens.css (var(--nome)).
   Visual "Legado" (v0.2): filigrana de ouro que some nas pontas, ◆ como ponto de luz, cantos chanfrados,
   brilho em quem está em foco, superfícies fundas em azul-carvão com uma névoa de luz no alto. */

:root {
  /* filigrana: linha de ouro que some nas duas pontas */
  --filigrana: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  --filigrana-v: linear-gradient(180deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  /* lavagem de ouro: o gradiente de hover/ativo que some para a direita */
  --lavagem: linear-gradient(90deg, var(--gold-wash), color-mix(in srgb, var(--gold-wash) 25%, transparent) 60%, transparent);
}

:where(body) {
  margin: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
    radial-gradient(90% 90% at 50% 100%, rgba(0, 0, 0, 0.45), transparent 70%),
    var(--surface-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

.gr-icon { display: block; flex: none; }
[data-icon] { display: inline-flex; }

/* Títulos: Cinzel em caixa alta, com ar e um halo de ouro */
.titulo-xl, .titulo-l, .titulo-m { letter-spacing: 0.12em; text-transform: uppercase; text-shadow: 0 0 14px var(--gold-glow); }

/* ---------- Painel: moldura dupla, cantoneiras de ouro e luz no topo ---------- */
.gr-panel {
  position: relative;
  background:
    radial-gradient(80% 40% at 50% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-100), color-mix(in srgb, var(--surface-100) 70%, var(--surface-0)));
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-panel);
  padding: var(--space-4);
}
/* filete interno (a moldura dupla) */
.gr-panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  pointer-events: none;
}
/* quatro cantoneiras de ouro */
.gr-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  --c: var(--gold);
  background:
    linear-gradient(var(--c), var(--c)) left 0 top 0 / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left 0 top 0 / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) right 0 top 0 / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right 0 top 0 / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) left 0 bottom 0 / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left 0 bottom 0 / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) right 0 bottom 0 / 16px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right 0 bottom 0 / 1px 16px no-repeat;
}
/* título entre duas filigranas */
.gr-panel__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 14px var(--gold-glow);
}
.gr-panel__title::before,
.gr-panel__title::after { content: ""; flex: 1; height: 1px; background: var(--filigrana); opacity: 0.7; }
/* Divisor: filigrana com um ◆ de luz no meio */
.gr-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  color: var(--gold);
}
.gr-divider::before,
.gr-divider::after { content: ""; flex: 1; height: 1px; background: var(--filigrana); }
.gr-divider > i { width: 6px; height: 6px; background: var(--gold-bright); transform: rotate(45deg); box-shadow: 0 0 8px var(--gold); }

/* ---------- Medidores de status (Vida, Fome, Sede, Energia) ----------
   Um losango que enche de baixo para cima, como um frasco de poção. Igual ao HUD do hp-status: um
   quadrado girado 45° com as pontas levemente arredondadas e borda fina de bronze, como o losango de
   item do próprio jogo; dentro, o líquido sobe reto e tem ondas na superfície. */
.gr-vital {
  --value: 100;
  --vital: var(--gold);
  --w: 60px;
  --h: 60px;
  --t: 1.5px;    /* espessura da borda */
  --round: 3px;  /* arredondamento das pontas */
  display: inline-grid;
  justify-items: center;
  gap: var(--space-1);
  min-width: 0;
}
.gr-vital[data-vital="vida"] { --vital: var(--vida); }
.gr-vital[data-vital="fome"] { --vital: var(--fome); }
.gr-vital[data-vital="sede"] { --vital: var(--sede); }
.gr-vital[data-vital="energia"] { --vital: var(--energia); }

.gr-vital__shape {
  position: relative;
  width: var(--w);
  height: var(--h);
  --edge: var(--line-strong);
  /* Sombra para ler sobre o cenário do jogo (o HUD não tem fundo) */
  filter: drop-shadow(0 1px 2px rgba(11, 14, 20, 0.9)) drop-shadow(0 0 4px rgba(11, 14, 20, 0.6));
}
/* O losango: quadrado girado com cantos redondos; o conteúdo gira de volta para o líquido subir reto */
.gr-vital__diamond {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--w) / 1.41421);
  height: calc(var(--h) / 1.41421);
  transform: translate(-50%, -50%) rotate(45deg);
  border: var(--t) solid var(--edge);
  border-radius: var(--round);
  overflow: hidden;
  background: var(--surface-0);
}
.gr-vital__inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--w);
  height: var(--h);
  transform: translate(-50%, -50%) rotate(-45deg);
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), var(--line-faint) calc(25% - 1px) 25%),
    var(--surface-0);
}
.gr-vital__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--value) * 1%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 70%),
    var(--vital);
  transition: height 400ms ease;
}
/* Superfície do líquido: um brilho logo abaixo e duas ondas em sentidos contrários
   (a de cor é a crista; a branca, o reflexo) */
.gr-vital__fill::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(rgba(255, 255, 255, 0.14), transparent);
}
.gr-vital__wave { position: absolute; left: -20px; right: -20px; height: 3px; }
.gr-vital__wave.a {
  bottom: 100%;
  margin-bottom: -1px;
  background: var(--vital);
  animation: gr-onda-a 3.2s linear infinite;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='3'%3E%3Cpath d='M0 1.5 C5 0.5 10 0.5 10 1.5 S15 2.5 20 1.5 V3 H0 Z'/%3E%3C/svg%3E") repeat-x 0 0 / 20px 3px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='3'%3E%3Cpath d='M0 1.5 C5 0.5 10 0.5 10 1.5 S15 2.5 20 1.5 V3 H0 Z'/%3E%3C/svg%3E") repeat-x 0 0 / 20px 3px;
}
.gr-vital__wave.b {
  top: -1.5px;
  opacity: 0.3;
  animation: gr-onda-b 4.6s linear infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='3'%3E%3Cpath d='M0 1.5 C5 2.5 10 2.5 10 1.5 S15 0.5 20 1.5' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='0.8'/%3E%3C/svg%3E") repeat-x 0 0 / 20px 3px;
}
@keyframes gr-onda-a { to { transform: translateX(20px); } }
@keyframes gr-onda-b { to { transform: translateX(-20px); } }
/* Vazio: sem superfície para ondular */
.gr-vital.is-empty .gr-vital__wave,
.gr-vital.is-empty .gr-vital__fill::before { display: none; }
.gr-vital__glyph {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  color: var(--ink);
  filter: drop-shadow(0 0 2px var(--surface-0)) drop-shadow(0 0 1px var(--surface-0));
}
.gr-vital__label {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 16px;
  color: var(--ink);
}
.gr-vital__value {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}
.gr-vital.is-low .gr-vital__value { color: var(--danger); }
.gr-vital.is-low .gr-vital__shape {
  --edge: var(--danger);
  animation: gr-pulse 1.4s ease-in-out infinite;
}
@keyframes gr-pulse {
  50% { filter: drop-shadow(0 0 6px var(--vital)); }
}

/* Linha dos quatro medidores */
.gr-vitals { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-end; }

/* Versão compacta para o HUD: losango de 40px, borda mais fina, sem número embaixo */
.gr-vital--compact { --w: 40px; --h: 40px; --t: 1.25px; --round: 2px; gap: 0; }

/* HUD do jogo: 232×80, sem fundo nem borda (a leitura sobre o cenário fica com a sombra dos losangos).
   O painel do microfone do hp-voz é irmão dele, com a mesma altura, nunca filho. */
.gr-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 232px;
  height: 80px;
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-m);
}
/* Um losango sozinho (modo separado do F7): painel de 64×80 */
.gr-hud--single { width: 64px; justify-content: center; padding: var(--space-2); }

/* ---------- Botões: cantos chanfrados, linha de ouro, brilho ao passar ----------
   O chanfro é um clip-path; a "borda" é o fundo do botão aparecendo 1px em volta do ::before. */
.gr-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 calc(var(--space-4) + 6px);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--line-strong);
  border: 0;
  clip-path: polygon(var(--chanfro) 0, calc(100% - var(--chanfro)) 0, 100% 50%, calc(100% - var(--chanfro)) 100%, var(--chanfro) 100%, 0 50%);
  cursor: pointer;
  transition: color 150ms ease, filter 150ms ease, background 150ms ease;
}
.gr-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: linear-gradient(180deg, var(--surface-200), var(--surface-100));
  clip-path: polygon(calc(var(--chanfro) - 0.5px) 0, calc(100% - var(--chanfro) + 0.5px) 0, 100% 50%, calc(100% - var(--chanfro) + 0.5px) 100%, calc(var(--chanfro) - 0.5px) 100%, 0 50%);
  transition: background 150ms ease;
}
.gr-btn:hover { background: var(--gold-bright); color: var(--gold-bright); filter: drop-shadow(0 0 6px var(--gold-glow)); }
.gr-btn:hover::before { background: linear-gradient(180deg, color-mix(in srgb, var(--surface-200) 80%, var(--gold)), var(--surface-100)); }
.gr-btn--primary { background: var(--gold-bright); color: var(--on-gold); }
.gr-btn--primary::before { background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, color-mix(in srgb, var(--gold) 85%, black)); }
.gr-btn--primary:hover { color: var(--on-gold); filter: drop-shadow(0 0 10px var(--gold-glow)); }
.gr-btn--primary:hover::before { background: linear-gradient(180deg, color-mix(in srgb, var(--gold-bright) 80%, white), var(--gold-bright) 55%, var(--gold)); }
.gr-btn--ghost { background: transparent; color: var(--ink-muted); }
.gr-btn--ghost::before { background: transparent; }
.gr-btn--ghost:hover { background: var(--line); color: var(--ink); filter: none; }
.gr-btn--ghost:hover::before { background: var(--surface-200); }
.gr-btn--danger { background: var(--danger); color: var(--danger); }
.gr-btn--danger:hover { background: color-mix(in srgb, var(--danger) 80%, white); color: color-mix(in srgb, var(--danger) 80%, white); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--danger) 45%, transparent)); }
.gr-btn--sm { min-height: 32px; padding: 0 calc(var(--space-3) + 4px); font-size: 11px; --chanfro: 7px; }
.gr-btn--icon { width: 40px; padding: 0; --chanfro: 8px; }
.gr-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
/* O clip-path corta o contorno de foco: no botão, o foco é um halo */
.gr-btn:focus-visible { outline: none; filter: drop-shadow(0 0 0 2px var(--focus)) drop-shadow(0 0 8px var(--gold-glow)); }

/* Tecla de atalho, como o prompt do jogo: placa escura com a letra em ouro */
.gr-key {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-1);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-bright);
  background: var(--surface-0);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 6px var(--gold-glow);
}
.gr-btn .gr-key { min-width: 20px; height: 20px; margin-left: -4px; border-color: color-mix(in srgb, var(--gold-bright) 55%, transparent); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7); }
.gr-btn--primary .gr-key { border-color: color-mix(in srgb, var(--on-gold) 60%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-bright) 35%, transparent), 0 1px 0 rgba(255, 255, 255, 0.25); }

:where(.gr-menu__item, .gr-select__trigger, .gr-select__option, .gr-check input, .gr-nav__item):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Menu: itens em Cinzel, lavagem de ouro ao passar e um ◆ que acende ---------- */
.gr-menu { min-width: 240px; padding: var(--space-2) var(--space-1); }
.gr-menu__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.gr-menu__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
/* o ◆ à esquerda: aparece no hover, fica aceso no item ativo */
.gr-menu__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  background: var(--gold);
  transform: rotate(45deg) scale(0);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.gr-menu__item .gr-icon { color: var(--ink-muted); }
.gr-menu__item > .gr-key { margin-left: auto; }
.gr-menu__item:hover { background: var(--lavagem); color: var(--gold-bright); }
.gr-menu__item:hover::before { transform: rotate(45deg) scale(1); }
.gr-menu__item:hover .gr-icon { color: var(--gold); }
.gr-menu__item[aria-current="true"] {
  background: var(--lavagem);
  color: var(--gold-bright);
  text-shadow: 0 0 10px var(--gold-glow);
}
.gr-menu__item[aria-current="true"] .gr-icon { color: var(--gold); }
.gr-menu__item[aria-current="true"]::before { background: var(--gold-bright); transform: rotate(45deg) scale(1); box-shadow: 0 0 8px var(--gold); }
.gr-menu__item--danger,
.gr-menu__item--danger .gr-icon { color: var(--danger); }
.gr-menu__item--danger::before { background: var(--danger); }
.gr-menu__item--danger:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 18%, transparent), transparent 70%); color: var(--danger); }
.gr-menu__item:disabled { opacity: 0.45; cursor: not-allowed; }
/* Item com descrição: o nome segue em Cinzel, o resto em texto corrido */
.gr-menu__body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.gr-menu__desc { font-family: var(--font-body); font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0; text-transform: none; text-shadow: none; color: var(--ink-muted); }
.gr-menu__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-family: var(--font-ui); font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.gr-menu__meta b { font-weight: 500; color: var(--gold); }
.gr-menu__img { width: 44px; height: 44px; flex: none; object-fit: contain; filter: drop-shadow(0 4px 7px #000); }
.gr-menu__item--success { color: var(--success); }
.gr-menu__item--warning { color: var(--gold); }
.gr-menu__sep { height: 1px; margin: var(--space-2); background: var(--filigrana); opacity: 0.6; border: 0; }

/* ---------- Dropdown (select) ---------- */
.gr-select { position: relative; min-width: 240px; }
.gr-select__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-3);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(180deg, var(--surface-200), var(--surface-100));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.gr-select__trigger:hover { border-color: var(--gold); }
.gr-select__value { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; }
.gr-select__trigger > .gr-icon,
.gr-select__trigger > [data-icon] { color: var(--gold); transition: transform 150ms ease; }
.gr-select.is-open .gr-select__trigger { border-color: var(--gold); box-shadow: var(--glow); }
.gr-select.is-open .gr-select__trigger > [data-icon] { transform: rotate(180deg); }
/* lista: moldura dupla de ouro */
.gr-select__list {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  display: none;
  margin: 0;
  padding: var(--space-2) var(--space-1);
  list-style: none;
  background: linear-gradient(180deg, var(--surface-100), var(--surface-0));
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-panel), inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 4px var(--surface-100), inset 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent);
}
.gr-select.is-open .gr-select__list { display: grid; gap: 2px; }
.gr-select__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  font-size: 16px;
  cursor: pointer;
}
.gr-select__option:hover,
.gr-select__option:focus { background: var(--lavagem); color: var(--gold-bright); outline: none; }
.gr-select__option[aria-selected="true"] { color: var(--gold-bright); }
.gr-select__option[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  background: var(--gold-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--gold);
}
/* Lista longa: campo de busca no topo e descrição embaixo do nome */
.gr-select__search { position: sticky; top: 0; z-index: 1; margin-bottom: var(--space-1); }
.gr-select__results { display: grid; gap: 2px; }
.gr-select__option--desc { flex-wrap: wrap; row-gap: 2px; }
.gr-select__label { flex: 1; min-width: 0; }
.gr-select__desc { flex: 0 0 100%; order: 1; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.gr-select__empty { padding: var(--space-2) var(--space-3); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.gr-select.is-invalid .gr-select__trigger { border-color: var(--danger); box-shadow: inset 0 -2px 0 var(--danger); }
/* Selo de casa: o animal da casa (leão, serpente, águia, texugo) em 14px na cor da casa, sempre ao lado do
   nome. Grimorio.paintIcons() põe o SVG dentro do .gr-crest; sem JS (ou com gr-crest--losango) fica o losango. */
.gr-crest { width: 10px; height: 10px; flex: none; transform: rotate(45deg); border-radius: 1px; background: var(--gold); color: var(--gold); }
.gr-crest[data-casa="grifinoria"] { background: var(--grifinoria); color: var(--grifinoria); }
.gr-crest[data-casa="sonserina"] { background: var(--sonserina); color: var(--sonserina); }
.gr-crest[data-casa="corvinal"] { background: var(--corvinal); color: var(--corvinal); }
.gr-crest[data-casa="lufa-lufa"] { background: var(--lufa-lufa); color: var(--lufa-lufa); }
.gr-crest:has(> .gr-icon) { width: auto; height: auto; display: inline-flex; transform: none; border-radius: 0; background: none; }

/* ---------- Formulários: rótulos em Cinzel, campos com linha de ouro embaixo ---------- */
.gr-form { display: grid; gap: var(--space-4); }
.gr-field { display: grid; gap: var(--space-1); min-width: 0; }
.gr-field__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.gr-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.gr-field__error { display: flex; align-items: center; gap: var(--space-1); font-size: 14px; line-height: 20px; color: var(--danger); }
.gr-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.05)), var(--surface-200);
  border: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.gr-input::placeholder { color: var(--ink-muted); font-style: italic; }
.gr-input:hover { border-color: var(--line-strong); }
.gr-input:focus-visible { outline: none; border-color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold-bright), 0 0 14px var(--gold-wash); }
textarea.gr-input { min-height: 88px; resize: vertical; }
.gr-input[type="number"] { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.gr-field.is-invalid .gr-input { border-color: var(--danger); box-shadow: inset 0 -2px 0 var(--danger); }
.gr-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.gr-row > * { flex: 1 1 160px; }

/* Slider: filete de ouro que enche até o polegar em ◆. O valor fica ao lado, com a unidade. */
.gr-range { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.gr-range input { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.gr-range input::-webkit-slider-runnable-track { height: 6px; border: 1px solid var(--line-strong); background: linear-gradient(90deg, var(--gold) var(--fill, 0%), var(--surface-0) var(--fill, 0%)); }
.gr-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 1px solid var(--on-gold); background: var(--gold-bright); transform: rotate(45deg); box-shadow: 0 0 8px var(--gold); }
.gr-range input:focus-visible { outline: none; }
.gr-range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--surface-100), 0 0 0 4px var(--focus); }
.gr-range output { min-width: 64px; text-align: right; font-family: var(--font-ui); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--gold-bright); }

.gr-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gr-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 16px; cursor: pointer; }
.gr-check input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  background: var(--surface-0);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gr-check input::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--on-gold);
  transform: rotate(45deg) scale(0);
  transition: transform 120ms ease;
}
.gr-check input:checked { background: var(--gold-bright); border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.gr-check input:checked::after { transform: rotate(45deg) scale(1); }
.gr-check input[type="radio"] { transform: rotate(45deg); border-radius: 1px; width: 15px; height: 15px; }
.gr-check input[type="radio"]::after { transform: scale(0); width: 7px; height: 7px; }
.gr-check input[type="radio"]:checked::after { transform: scale(1); }
/* Opção em pílula chanfrada (ano letivo etc.) */
.gr-chip { position: relative; }
.gr-chip input { position: absolute; opacity: 0; pointer-events: none; }
.gr-chip span {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 32px;
  padding: 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  background: var(--surface-100);
  border: 1px solid var(--line);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.gr-chip span:hover { color: var(--gold-bright); background: var(--surface-200); }
.gr-chip input:checked + span,
.gr-chip input:checked + span:hover { color: var(--on-gold); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: var(--gold); }
.gr-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Menu lateral: filigrana vertical e item ativo com luz ---------- */
.gr-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 248px;
  box-sizing: border-box;
  padding: var(--space-4) var(--space-3);
  background:
    radial-gradient(90% 30% at 50% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-100), var(--surface-0));
}
.gr-sidebar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 1px;
  background: var(--filigrana-v);
  pointer-events: none;
}
.gr-profile { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-1); }
/* selo do perfil: losango com anel duplo */
.gr-profile__seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 3px;
  flex: none;
  color: var(--gold);
  background: var(--surface-0);
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--gold-glow), inset 0 0 0 3px var(--surface-0), inset 0 0 0 4px color-mix(in srgb, var(--gold) 40%, transparent);
}
.gr-profile__seal > * { transform: rotate(-45deg); }
.gr-profile__name { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 20px; color: var(--gold-bright); }
.gr-profile__meta { display: flex; align-items: center; gap: var(--space-1); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.gr-nav { display: grid; gap: 2px; }
.gr-nav__heading {
  margin: var(--space-3) var(--space-3) var(--space-1);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.gr-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.gr-nav__item::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  background: var(--gold);
  transform: rotate(45deg) scale(0);
  transition: transform 150ms ease;
}
.gr-nav__item .gr-icon { color: var(--ink-muted); }
.gr-nav__item:hover { background: var(--lavagem); color: var(--gold-bright); }
.gr-nav__item:hover::before { transform: rotate(45deg) scale(1); }
.gr-nav__item[aria-current="page"] { background: var(--lavagem); color: var(--gold-bright); text-shadow: 0 0 10px var(--gold-glow); }
.gr-nav__item[aria-current="page"] .gr-icon { color: var(--gold); }
.gr-nav__item[aria-current="page"]::before { background: var(--gold-bright); transform: rotate(45deg) scale(1); box-shadow: 0 0 8px var(--gold); }
.gr-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-gold);
  background: var(--gold);
  transform: skewX(-8deg);
  box-shadow: 0 0 6px var(--gold-glow);
}
.gr-sidebar__footer { margin-top: auto; padding-top: var(--space-3); }
.gr-sidebar__footer::before { content: ""; display: block; height: 1px; margin-bottom: var(--space-2); background: var(--filigrana); opacity: 0.6; }
.gr-sidebar--collapsed { width: 64px; align-items: center; }
.gr-sidebar--collapsed .gr-nav__item { padding-left: var(--space-3); }
.gr-sidebar--collapsed .gr-nav__label,
.gr-sidebar--collapsed .gr-nav__heading,
.gr-sidebar--collapsed .gr-profile__text,
.gr-sidebar--collapsed .gr-badge { display: none; }

/* ---------- Aviso (toast): painel pequeno no canto, com ◆ de ícone no tom ---------- */
.gr-toasts { position: fixed; top: var(--space-6); right: var(--space-6); z-index: 20; display: grid; gap: var(--space-2); width: min(360px, calc(100vw - 48px)); }
.gr-toast { --tone: var(--gold); display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; column-gap: var(--space-3); animation: gr-toast-in 0.2s ease-out; }
.gr-toast--success { --tone: var(--success); }
.gr-toast--error { --tone: var(--danger); }
.gr-toast__mark { position: relative; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px 0 -4px -2px; color: var(--tone); }
.gr-toast__mark::before { content: ""; position: absolute; inset: 5px; border: 1.5px solid currentColor; background: var(--surface-200); transform: rotate(45deg); box-shadow: 0 0 8px color-mix(in srgb, var(--tone) 45%, transparent); }
.gr-toast__mark > * { position: relative; }
.gr-toast__body { min-width: 0; }
.gr-toast__title { display: block; margin-bottom: 2px; font-family: var(--font-display); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.gr-toast__text { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); overflow-wrap: anywhere; }
.gr-toast.is-leaving { animation: gr-toast-out 0.18s ease-in forwards; }
@keyframes gr-toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes gr-toast-out { to { opacity: 0; transform: translateX(18px); } }

/* ---------- Aviso de item: fila curta de "+1 Mandrágora" no canto, com o ícone do item e a raridade na borda ---------- */
.gr-itemfeed { display: grid; justify-items: end; gap: 6px; width: min(300px, calc(100vw - 48px)); }
.gr-itemfeed__row { --tone: var(--line-strong); display: grid; grid-template-columns: 36px auto minmax(0, 1fr); align-items: center; column-gap: var(--space-2); max-width: 100%; padding: 4px var(--space-3) 4px 4px; background: linear-gradient(90deg, rgba(15, 20, 29, 0.94), rgba(15, 20, 29, 0.8)); border: 1px solid var(--line); border-right: 2px solid var(--tone); border-radius: var(--radius-s); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); animation: gr-itemfeed-in 0.2s ease-out; }
.gr-itemfeed__icon { display: grid; place-items: center; width: 36px; height: 36px; background: radial-gradient(circle at 50% 42%, #1f2838, var(--surface-100) 80%); border: 1px solid var(--tone); border-radius: var(--radius-s); }
.gr-itemfeed__icon img { width: 80%; height: 80%; object-fit: contain; }
.gr-itemfeed__delta { font-family: var(--font-ui); font-size: 16px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-bright); }
.gr-itemfeed__row.is-minus .gr-itemfeed__delta { color: var(--ink-muted); }
.gr-itemfeed__text { min-width: 0; }
.gr-itemfeed__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; color: var(--ink); }
.gr-itemfeed__why { display: block; font-family: var(--font-ui); font-size: 12px; line-height: 14px; color: var(--ink-muted); }
.gr-itemfeed__row.is-leaving { animation: gr-itemfeed-out 0.18s ease-in forwards; }
[data-rarity="common"] { --tone: var(--raridade-comum); }
[data-rarity="uncommon"] { --tone: var(--raridade-incomum); }
[data-rarity="rare"] { --tone: var(--raridade-raro); }
[data-rarity="epic"] { --tone: var(--raridade-epico); }
[data-rarity="legendary"] { --tone: var(--raridade-lendario); }
@keyframes gr-itemfeed-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes gr-itemfeed-out { to { opacity: 0; transform: translateX(14px); } }

/* ---------- Aviso de interação: nome sobre a filigrana e a tecla com a ação. Sem fundo, como o HUD: a sombra garante a leitura ---------- */
.gr-prompt { position: fixed; left: 50%; bottom: 16vh; z-index: 5; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; width: min(300px, calc(100vw - 48px)); text-align: center; text-shadow: 0 1px 2px var(--surface-0), 0 0 8px var(--surface-0); animation: gr-prompt-in 0.16s ease-out; }
.gr-prompt[hidden] { display: none; }
/* Preso a um ponto do mundo: quem chama põe left e top, e o aviso fica logo acima do ponto */
.gr-prompt--mundo { bottom: auto; transform: translate(-50%, -100%); }
.gr-prompt.is-fora { visibility: hidden; }
/* Na lateral da tela: aviso que dura enquanto um estado durar, longe do centro onde ficam os avisos de NPC e objeto */
.gr-prompt--lateral { left: 24px; top: 50%; bottom: auto; transform: translateY(-50%); justify-items: start; width: max-content; max-width: calc(100vw - 48px); }
.gr-prompt--direita { left: auto; right: 24px; top: 50%; bottom: auto; transform: translateY(-50%); justify-items: end; width: max-content; max-width: calc(100vw - 48px); }
.gr-prompt--topo { top: 12vh; bottom: auto; }
.gr-prompt__title { font-family: var(--font-display); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-bright); overflow-wrap: anywhere; }
.gr-prompt .gr-divider { width: 100%; margin: 0; }
.gr-prompt__action { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 15px; line-height: 22px; color: var(--ink); }
.gr-prompt__action .gr-key { text-shadow: none; }
@keyframes gr-prompt-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Abas: trocam o conteúdo da mesma janela; a escolhida ganha o filete de ouro ---------- */
.gr-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line-faint); }
.gr-tab { font-family: var(--font-label); font-size: 14px; line-height: 18px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: var(--space-3) var(--space-4) 10px; cursor: pointer; transition: color 150ms ease, border-color 150ms ease; }
.gr-tab:hover { color: var(--ink); }
.gr-tab[aria-selected="true"] { color: var(--gold-bright); border-bottom-color: var(--gold); }
.gr-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.gr-tab__count { margin-left: 6px; font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Barra de progresso: horizontal, para tempo e tarefas (o losango é só para o corpo) ---------- */
.gr-progress { height: 8px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-0); }
.gr-progress__fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); box-shadow: 0 0 8px var(--gold-glow); transition: width 80ms linear; }
.gr-progress__time { margin-top: var(--space-2); text-align: right; font-family: var(--font-ui); font-size: 13px; line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--gold-bright); }

/* Barra fina (dentro de item de menu) e tons: o tom diz o que o número significa, nunca sozinho */
.gr-progress--sm { height: 4px; }
.gr-progress--success .gr-progress__fill { background: var(--success); box-shadow: 0 0 6px color-mix(in srgb, var(--success) 45%, transparent); }
.gr-progress--danger .gr-progress__fill { background: var(--danger); box-shadow: 0 0 6px color-mix(in srgb, var(--danger) 45%, transparent); }

/* ---------- Menu: valor que troca com ← →, marcação em losango, submenu e dicas de teclas ---------- */
.gr-menu__value { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.gr-menu__value::before { content: "\2039"; color: var(--gold); }
.gr-menu__value::after { content: "\203A"; color: var(--gold); }
.gr-menu__item[aria-current="true"] .gr-menu__value { color: var(--gold-bright); }
.gr-menu__count { font-size: 12px; color: var(--ink-muted); }
.gr-menu__check { flex: none; width: 12px; height: 12px; margin: 0 4px 0 auto; border: 1.5px solid var(--line-strong); background: var(--surface-0); transform: rotate(45deg); transition: background 150ms ease, box-shadow 150ms ease; }
.gr-menu__check[aria-checked="true"] { background: var(--gold-bright); border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.gr-menu__go { margin-left: auto; color: var(--ink-muted); transform: rotate(-90deg); }
.gr-menu__item--readonly { cursor: default; }
.gr-menu__item--readonly:hover { background: transparent; color: var(--ink); }
.gr-menu__item--readonly::before { display: none; }
.gr-menu__body .gr-progress { margin-top: 4px; }
.gr-menu__hints { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3) var(--space-1); font-family: var(--font-ui); font-size: 13px; line-height: 22px; color: var(--ink-muted); }
.gr-menu__hints .gr-key { margin-right: 6px; }

/* ---------- Anel: progresso em volta (circular) e teste de habilidade ---------- */
.gr-ring { --size: 104px; --value: 0; position: relative; display: grid; place-items: center; width: var(--size); height: var(--size); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7)); }
.gr-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.gr-ring__edge { fill: none; stroke: var(--line-strong); stroke-width: 9; }
.gr-ring__track { fill: none; stroke: var(--surface-0); stroke-width: 7; }
.gr-ring__fill { fill: none; stroke: var(--gold-bright); stroke-width: 5; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--value)); filter: drop-shadow(0 0 4px var(--gold-glow)); transition: stroke-dashoffset 80ms linear; }
.gr-ring__value { position: relative; font-family: var(--font-ui); font-size: 18px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-bright); text-shadow: 0 1px 3px #000; }
.gr-ring__label { position: absolute; top: calc(100% + var(--space-3)); left: 50%; transform: translateX(-50%); width: max-content; max-width: 320px; font-family: var(--font-label); font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink); text-align: center; text-shadow: 0 1px 2px var(--surface-0), 0 0 8px var(--surface-0); }
/* Losango: a mesma moldura, na forma do sistema; enche em volta a partir da ponta de cima */
.gr-ring--losango { --size: 116px; }
.gr-ring--losango > svg { transform: none; }
.gr-ring--losango :is(.gr-ring__edge, .gr-ring__track, .gr-ring__fill) { stroke-linejoin: round; }
/* Teste de habilidade: a faixa de acerto acesa no anel e o ◆ que corre em volta; a tecla no centro */
.gr-ring--skill { --size: 128px; --angle: 0deg; }
.gr-ring__zone { fill: none; stroke: var(--gold-bright); stroke-width: 7; filter: drop-shadow(0 0 5px var(--gold-glow)); }
.gr-ring__needle { position: absolute; inset: -3px; transform: rotate(var(--angle)); pointer-events: none; }
.gr-ring__needle::before { content: ""; position: absolute; left: 50%; top: 0; width: 13px; height: 13px; margin-left: -6.5px; background: var(--ink); border: 1.5px solid var(--surface-0); transform: rotate(45deg); box-shadow: 0 0 10px var(--gold-bright); }
.gr-ring--skill .gr-key { min-width: 36px; height: 36px; font-size: 18px; }
.gr-ring.is-hit .gr-ring__zone { stroke: var(--success); filter: drop-shadow(0 0 6px var(--success)); }
.gr-ring.is-miss .gr-ring__zone, .gr-ring.is-miss .gr-ring__edge { stroke: var(--danger); }
.gr-ring.is-miss .gr-ring__needle::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* Barra de rolagem fina, na cor das linhas */
.gr-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.gr-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.gr-scroll::-webkit-scrollbar-track { background: transparent; }
.gr-scroll::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid transparent; background-clip: padding-box; }
.gr-scroll::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }

/* ---------- Menu radial (F2) ----------
   Anel de setores de vidro escuro com moldura dupla e ◆ luminosos, cubo central com o nome e a descrição da
   opção. Igual ao do hmp-ui. */
.gr-radial {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 15;
  cursor: default;
  user-select: none;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--surface-0) 15%, transparent) 0, color-mix(in srgb, var(--surface-0) 70%, transparent) 46%, color-mix(in srgb, var(--surface-0) 90%, transparent) 100%);
}
.gr-radial.is-open { display: grid; }
.gr-radial--inline { position: absolute; } /* dentro de uma caixa (prévias), não da tela */
.gr-radial__wheel { position: relative; width: var(--size); height: var(--size); animation: gr-wheel-in 0.16s ease-out; }
.gr-radial__wheel.step { animation: gr-wheel-step 0.14s ease-out; }
.gr-radial__wheel > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
@keyframes gr-wheel-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes gr-wheel-step { from { opacity: 0.4; transform: scale(0.96); } to { opacity: 1; transform: none; } }
/* Moldura dupla em volta do anel (a externa pontilhada), com um ◆ de luz a cada quarto de volta */
.gr-radial__rim { fill: none; stroke: color-mix(in srgb, var(--gold) 18%, transparent); stroke-width: 1; stroke-dasharray: 2 6; }
.gr-radial__rim-strong { fill: none; stroke: color-mix(in srgb, var(--gold) 45%, transparent); stroke-width: 1; }
.gr-radial__rim-mark { fill: var(--gold-bright); stroke: var(--surface-0); stroke-width: 1; filter: drop-shadow(0 0 4px var(--gold)); }
/* Setores */
.gr-radial__sector { fill: color-mix(in srgb, var(--surface-100) 86%, transparent); stroke: color-mix(in srgb, var(--gold) 35%, transparent); stroke-width: 1; fill-rule: evenodd; transition: fill 120ms ease, stroke 120ms ease; }
.gr-radial__sector-inner { fill: none; stroke: color-mix(in srgb, var(--gold) 12%, transparent); stroke-width: 1; pointer-events: none; }
.gr-radial__sector.on { fill: color-mix(in srgb, var(--surface-200) 96%, transparent); stroke: var(--gold-bright); filter: drop-shadow(0 0 16px var(--gold-glow)); }
.gr-radial__sector.on + .gr-radial__sector-inner { stroke: color-mix(in srgb, var(--gold-bright) 45%, transparent); }
.gr-radial__sector.off { fill: color-mix(in srgb, var(--surface-0) 90%, transparent); }
.gr-radial__sector.error.on { stroke: var(--danger); }
.gr-radial__chevron { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.gr-radial__chevron.on { stroke: var(--gold-bright); }
/* Cubo central e o ◆ que aponta o setor em foco */
.gr-radial__hub { fill: var(--surface-100); stroke: var(--gold); stroke-width: 1; filter: drop-shadow(0 0 10px var(--gold-glow)); }
.gr-radial__hub-inner { fill: none; stroke: color-mix(in srgb, var(--gold) 30%, transparent); stroke-width: 1; stroke-dasharray: 1 4; }
.gr-radial__hub.on { stroke: var(--gold-bright); }
.gr-radial__pointer { fill: var(--gold-bright); stroke: var(--on-gold); stroke-width: 1; transition: opacity 120ms ease; filter: drop-shadow(0 0 6px var(--gold-bright)); }
/* Ícone, rótulo e número de cada opção */
.gr-radial__slot { position: absolute; width: var(--slot); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; text-align: center; pointer-events: none; color: var(--gold); }
.gr-radial__glyph { width: 28px; height: 28px; display: grid; place-items: center; transition: color 120ms ease, transform 120ms ease; }
.gr-radial__glyph svg { width: 26px; height: 26px; }
.gr-radial__glyph svg[viewBox="0 0 512 512"] { width: 30px; height: 30px; }
img.gr-radial__glyph { object-fit: contain; filter: drop-shadow(0 3px 6px #000); }
.gr-radial__label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-family: var(--font-display); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; overflow-wrap: anywhere; transition: color 120ms ease; }
.gr-radial__slot.on { color: var(--gold-bright); }
.gr-radial__slot.on .gr-radial__glyph { transform: scale(1.12); filter: drop-shadow(0 0 8px var(--gold)); }
.gr-radial__slot.on .gr-radial__label { color: var(--gold-bright); text-shadow: 0 0 10px var(--gold-glow); }
.gr-radial__slot.success .gr-radial__label { color: var(--success); }
.gr-radial__slot.error, .gr-radial__slot.error .gr-radial__label { color: var(--danger); }
.gr-radial__slot.warning .gr-radial__label { color: var(--gold); }
.gr-radial__slot.off { color: var(--ink-muted); opacity: 0.5; }
.gr-radial__slot.off .gr-radial__label { color: var(--ink-muted); }
.gr-radial__num { color: var(--ink-muted); font-family: var(--font-ui); font-size: 11px; line-height: 12px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.8; }
/* Texto do cubo: de onde veio, nome e descrição */
.gr-radial__hub-text { position: absolute; left: 50%; top: 50%; width: var(--hub); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; text-align: center; pointer-events: none; }
.gr-radial__eyebrow { margin: 0; color: var(--ink-muted); font-family: var(--font-display); font-size: 9px; line-height: 16px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.gr-radial__title { margin: 0; color: var(--gold); font-family: var(--font-display); font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-shadow: 0 0 14px var(--gold-glow); overflow-wrap: anywhere; }
.gr-radial__hub-text .gr-divider { width: 60%; margin: 6px 0; }
.gr-radial__text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: var(--ink-muted); font-family: var(--font-body); font-size: 14px; line-height: 19px; }
.gr-radial__text.warn { color: var(--danger); }
/* Dica de teclas embaixo do anel */
.gr-radial__hint { position: absolute; left: 50%; top: calc(100% + 18px); transform: translateX(-50%); display: flex; gap: var(--space-4); white-space: nowrap; color: var(--ink-muted); font-family: var(--font-ui); font-size: 13px; font-weight: 500; }
.gr-radial__hint .gr-key { margin-right: 6px; }


/* HudItem: losango de item rápido na tela de jogo, ao lado da barra de feitiços. Mesmo desenho dos espaços dela (cb-magia/dist/barra.html). */
.gr-huditem { position: relative; width: 100px; height: 130px; font-family: var(--font-ui); }
.gr-huditem__shape { position: absolute; left: 18px; top: 36px; width: 64px; height: 64px; transform: rotate(45deg); background: rgba(14, 15, 18, 0.45); border: 1.5px solid #b89a5e; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 3px 10px rgba(0, 0, 0, 0.55); }
.gr-huditem__shape::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(255, 255, 255, 0.1); }
.gr-huditem__icon { position: absolute; left: 19px; top: 37px; width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.75)); }
.gr-huditem__glyph { position: absolute; left: 34px; top: 52px; width: 32px; height: 32px; color: var(--ink-muted); opacity: 0.7; }
.gr-huditem__glyph svg { display: block; width: 100%; height: 100%; }
.gr-huditem__count { position: absolute; right: 6px; top: 86px; min-width: 24px; font-size: 18px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--gold-bright); text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.gr-huditem__key { position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: linear-gradient(#3a3b3f, #1e1f22); border: 1px solid rgba(255, 255, 255, 0.22); color: #f4f1ea; font-size: 18px; line-height: 1; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.gr-huditem.is-empty .gr-huditem__shape { border-color: rgba(184, 154, 94, 0.45); }

@media (prefers-reduced-motion: reduce) {
  .gr-vital.is-low .gr-vital__shape, .gr-vital__wave { animation: none; }
  .gr-vital__fill, .gr-check input::after { transition: none; }
  .gr-btn, .gr-btn::before, .gr-menu__item, .gr-menu__item::before, .gr-nav__item, .gr-nav__item::before, .gr-input, .gr-chip span, .gr-select__trigger { transition: none; }
  .gr-radial__wheel, .gr-toast, .gr-toast.is-leaving, .gr-prompt, .gr-itemfeed__row, .gr-itemfeed__row.is-leaving { animation-duration: 1ms; }
  .gr-progress__fill, .gr-ring__fill, .gr-menu__check { transition: none; }
  .gr-radial__sector, .gr-radial__glyph, .gr-radial__label { transition: none; }
}
