/* ---------- Roll de tasks ----------
   Página #roll (js/views/roll.js), cartões e painel partilhados (js/components/roll-card.js, também no
   cartão da vista Jogador) e chip flutuante "Task atual" (js/components/roll-chip.js).
   Só tokens: segue a paleta guardada; os cartões recebem o tema do boss (--boss-*, App.ui.bossTheme).
   Títulos em Cinzel (--font-ornate), corpo em Inter. */

/* ---------- Página ---------- */
.roll-head .roll-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-ornate);
  font-size: var(--fs-2xl);
}
.roll-head .roll-title > .icon { width: 30px; height: 30px; color: var(--red-text); }
:is(.roll-main-card, .roll-side-card, .roll-history-card, .roll-card) .card-title { font-family: var(--font-ornate); }
.roll-rule {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--warn);
  font-weight: 600;
}
.roll-rule .icon { margin-top: 2px; }
.roll-rule-head { max-width: 70ch; }

.roll-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}
.roll-col-main, .roll-col-side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (min-width: 1000px) {
  .roll-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ---------- Cabeçalho: modo + resumo; separadores ---------- */
.roll-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-3); }
.roll-tierbar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.roll-head-row .roll-tierbar { flex: 1 1 320px; }
.roll-tierbar-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-weight: 700; }
.roll-tierbar-bar { display: block; height: 8px; max-width: 420px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.roll-tierbar-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--red-text); }
.roll-tierbar[data-tier="easy"] .roll-tierbar-bar > span { background: var(--tier-easy); }
.roll-tierbar[data-tier="medium"] .roll-tierbar-bar > span { background: var(--tier-medium); }
.roll-tierbar[data-tier="hard"] .roll-tierbar-bar > span { background: var(--tier-hard); }
.roll-tierbar[data-tier="elite"] .roll-tierbar-bar > span { background: var(--tier-elite); }
.roll-tierbar[data-tier="master"] .roll-tierbar-bar > span { background: var(--tier-master); }
.roll-tierbar[data-tier="gm"] .roll-tierbar-bar > span { background: var(--tier-gm); }
.roll-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.roll-summary .roll-pill { color: var(--text); }
.roll-tabs-wrap { display: flex; flex-direction: column; gap: var(--sp-4); }
.roll-tabs {
  display: flex; gap: 4px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: thin;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: calc(var(--header-h) + 4px); z-index: 5;
}
.roll-tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 16px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font: inherit; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
}
.roll-tab:hover { color: var(--text); background: var(--surface-2); }
.roll-tab[aria-selected="true"] { background: var(--red); color: var(--on-red); }
.roll-tab:focus-visible { outline: none; box-shadow: var(--focus); }
.roll-tabpanel:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
.roll-tabpanel[hidden] { display: none; }
.roll-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.roll-settings-col { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (min-width: 1000px) { .roll-settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.roll-progress-tab { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (max-width: 760px) {
  .roll-tabs { top: auto; position: static; }
  .roll-tab { padding: 6px 10px; }
}

/* ---------- Resumo compacto na página Jogador (só tasks ativas) ---------- */
.roll-compact { display: flex; flex-direction: column; gap: var(--sp-2); }
.roll-compact-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.roll-compact-title { font-weight: 700; color: var(--text-2); }
.roll-compact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.roll-compact-item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--boss-accent-2, var(--red)); border-radius: var(--radius-sm);
}
.roll-compact-art { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }
.roll-compact-art:not(.is-emblem) { object-fit: cover; }
.roll-compact-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.roll-compact-name { font-family: var(--font-ornate); font-weight: 700; overflow-wrap: anywhere; }
.roll-compact-name a { color: var(--text); text-decoration: none; }
.roll-compact-name a:hover { text-decoration: underline; }
.roll-compact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--text-2); }
.roll-compact-cta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.roll-compact-cta .btn { text-decoration: none; }
@media (max-width: 640px) {
  .roll-compact-item { grid-template-columns: 40px minmax(0, 1fr); }
  .roll-compact-art { width: 40px; height: 40px; }
  .roll-compact-cta { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Progresso ---------- */
.roll-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.roll-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
}
.roll-stat-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.roll-stat-value { font-family: var(--font-ornate); font-weight: 700; font-size: var(--fs-lg); line-height: 1.25; color: var(--text); }
.roll-stat-sub { color: var(--text-2); }
.roll-stat-tiers { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-xs); font-weight: 700; }
.roll-stat-tiers li { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.roll-stat-tiers li.is-zero { color: var(--muted); }
@media (max-width: 760px) {
  .roll-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roll-stats > .roll-stat:first-of-type { grid-column: 1 / -1; }
}

/* ---------- Modo e botões segmentados ---------- */
.roll-seg-label, .roll-field-label { font-weight: 700; font-size: var(--fs-sm); color: var(--text-2); }
.roll-seg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 3px;
  gap: 2px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.roll-seg-btn {
  min-height: 36px;
  min-width: 44px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.roll-seg-btn:hover { color: var(--text); background: var(--surface-2); }
.roll-seg-btn[aria-pressed="true"] { background: var(--red); color: var(--on-red); }
/* Nas definições (coluna estreita): colunas iguais a toda a largura, o texto pode ir a duas linhas */
.roll-fields .roll-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border-radius: var(--radius); }
.roll-fields .roll-seg-btn { padding: 4px 6px; border-radius: var(--radius-sm); line-height: 1.2; }
.roll-seg-sm .roll-seg-btn { min-height: 30px; min-width: 36px; padding: 2px 10px; font-size: var(--fs-xs); }

/* ---------- Definições e filtros ---------- */
.roll-fields { display: flex; flex-direction: column; gap: var(--sp-4); }
.roll-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.roll-filters-count {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.roll-filters-count.is-zero { background: var(--warn-bg); color: var(--warn); }
.roll-filters-hint[hidden] { display: none; }
.chip-tier:disabled, .roll-filter-check input:disabled + span { opacity: 0.55; cursor: not-allowed; }
.roll-style-chip, .chip-tier { min-height: 32px; }
.roll-filter-boss-row { display: flex; gap: var(--sp-2); }
.roll-filter-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-sm);
}
.roll-filter-input::placeholder { color: var(--muted); }
.roll-filters-msg:empty { display: none; }
.roll-filters-msg { color: var(--warn); }
.roll-boss-chips { list-style: none; padding: 0; margin: 0; }
.roll-boss-chips:empty { display: none; }
.roll-boss-chip { min-height: 32px; }
.roll-checks { gap: 4px; }
.roll-filter-check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; font-size: var(--fs-sm); cursor: pointer; }
.roll-filter-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--red); }
.roll-filters-clear { align-self: flex-start; }

/* ---------- Painel: aviso, tasks ativas, ofertas, sortear ---------- */
.roll-panel { display: flex; flex-direction: column; gap: var(--sp-4); }
.roll-sub { font-family: var(--font-ornate); font-weight: 700; font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.roll-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-line);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.roll-undo { color: var(--ok); border-color: var(--ok-line); }
.roll-notice[data-type="tier"] {
  background: linear-gradient(115deg, var(--warn-bg), color-mix(in srgb, var(--warn) 18%, var(--warn-bg)));
  color: var(--warn); border-color: var(--warn-line); font-size: var(--fs-base);
}
.roll-notice[data-type="tier"]::before { content: "°5"; margin-right: 4px; }
.roll-active-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }

.roll-draw {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.roll-go { min-height: 48px; padding-inline: 24px; font-size: var(--fs-base); font-weight: 700; gap: 8px; }
.roll-go:disabled { cursor: not-allowed; opacity: 0.55; }
.roll-go[aria-busy="true"] .icon { animation: roll-spin 0.5s linear infinite; }
.roll-draw-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 240px; min-width: 0; }
.roll-why { color: var(--text-2); }
.roll-why.is-blocked { color: var(--warn); font-weight: 600; }
.roll-why .roll-filters-clear { margin-top: 4px; }

/* Cartão da task ativa */
.roll-task {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--boss-accent-2, var(--red));
  border-radius: var(--radius);
  animation: roll-card-in 0.28s var(--ease);
}
@keyframes roll-card-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.roll-task-art {
  position: relative;
  aspect-ratio: 16 / 6;
  max-height: 220px;
  background: var(--boss-bg-deep, var(--bg-deep));
  overflow: hidden;
}
.roll-task-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.roll-task-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 35%, var(--surface-2) 100%);
}
.roll-task-main { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) var(--sp-4); min-width: 0; }
.roll-task-art + .roll-task-main { margin-top: -28px; position: relative; }
.roll-task-eyebrow { color: var(--boss-accent-text, var(--red-text)); }
.roll-task-name, .roll-offer-name {
  font-family: var(--font-ornate);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  overflow-wrap: anywhere;
}
.roll-task-name { font-size: var(--fs-lg); }
.roll-task-boss { font-size: var(--fs-sm); color: var(--text-2); }
.roll-task-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.roll-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.roll-type[data-type="speed"] { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.roll-req { margin: 0; }
.roll-req-ok .roll-pill { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.roll-req-missing .roll-pill { color: var(--text); border-color: var(--warn-line); background: var(--warn-bg); border-radius: var(--radius-sm); }
.roll-req-unknown { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.roll-task-req, .roll-offer-req { color: var(--text-2); overflow-wrap: anywhere; }
.roll-task-cta, .roll-offer-cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.roll-task-cta .btn, .roll-offer-cta .btn { text-decoration: none; }
.roll-task-guide-btn { display: inline-flex; align-items: center; gap: 6px; }
.roll-task-guide { display: flex; flex-direction: column; gap: var(--sp-1); }
.roll-task-label { font-weight: 700; color: var(--text-2); }

/* Preparação (js/components/prep.js): secção colapsável no cartão da task ativa */
.prep { border-top: 1px solid var(--line); margin-top: var(--sp-1); padding-top: var(--sp-2); min-width: 0; }
.prep-head { margin: 0; font: inherit; }
.prep-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  color: var(--text);
  font: 700 var(--fs-sm)/1.3 var(--font-body, Inter, system-ui, sans-serif);
  text-align: left;
  cursor: pointer;
}
.prep-toggle:hover { border-color: var(--boss-gold, var(--gold-line)); }
.prep-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.prep-chev { width: 0.6em; height: 0.6em; flex: none; align-self: center; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s var(--ease); }
.prep-toggle[aria-expanded="true"] .prep-chev { transform: rotate(45deg); }
.prep-title { font-family: var(--font-ornate); letter-spacing: 0.02em; }
.prep-hint { color: var(--text-2); font-weight: 600; }
.prep-body { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-3); min-width: 0; }
.prep-body[hidden] { display: none; }
.prep-block { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.prep-sub { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.prep-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.prep-style {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--boss-edge, var(--line-strong));
  background: var(--surface);
  color: var(--text);
  font: 700 0.875rem/1.2 var(--font-body, Inter, system-ui, sans-serif);
  cursor: pointer;
}
.prep-style:hover { border-color: var(--boss-gold, var(--gold-line)); }
.prep-style:focus-visible { outline: none; box-shadow: var(--focus); }
.prep-style[aria-checked="true"], .prep-styles.is-single .prep-style {
  border-color: var(--boss-gold, var(--gold-line));
  background: var(--boss-bg-deep, var(--bg-deep));
  box-shadow: inset 0 -2px 0 var(--boss-gold, var(--gold-line));
}
.prep-styles.is-single .prep-style { cursor: default; }
.prep-style .chip-style { width: 26px; height: 26px; }
.prep-match, .prep-lang, .prep-note { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.prep-match strong { color: var(--text); }
.prep .gear-presets, .prep .gear-presets.is-multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.prep .gear-preset { max-width: 100%; }
.prep-rot-steps { min-width: 0; }
.prep-rot-steps .step { padding: 6px var(--sp-3); line-height: 1.8; }
.prep-rot-steps .phase-head { padding: 8px var(--sp-3); }
.prep-notes > summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.prep-notes > summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.prep-notes p { margin: var(--sp-1) 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.prep-norot { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-2); font-weight: 600; }
.prep-reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); }
.prep-reqs li { overflow-wrap: anywhere; }
.prep-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.prep-links .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .prep-chev { transition: none; } }

/* Ofertas: 3 cartões lado a lado (1 coluna em ecrã estreito) */
.roll-offers-help { margin-bottom: var(--sp-3); }
.roll-offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.roll-offer-item { display: flex; min-width: 0; }
.roll-offer {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--boss-accent-2, var(--red));
  border-radius: var(--radius);
  animation: roll-card-in 0.28s var(--ease) both;
}
.roll-offer-item:nth-child(2) .roll-offer { animation-delay: 0.06s; }
.roll-offer-item:nth-child(3) .roll-offer { animation-delay: 0.12s; }
.roll-offer:focus-within { border-color: var(--boss-accent, var(--red-text)); }
.roll-offer .roll-task-art { aspect-ratio: 16 / 7; max-height: 140px; }
.roll-offer-main { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); flex: 1 1 auto; min-width: 0; }
.roll-offer .roll-task-art + .roll-offer-main { margin-top: -22px; position: relative; }
.roll-offer-name { font-size: var(--fs-md); }
.roll-offer-req {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.roll-offer-cta { margin-top: auto; padding-top: var(--sp-1); }
.roll-offer-accept { gap: 6px; }
.roll-offer-accept:disabled { opacity: 0.55; cursor: not-allowed; }

/* Animação do sorteio (~1 s) */
.roll-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.roll-slot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 84px;
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.roll-slot.is-still { border-style: solid; border-color: var(--red-text); }
.roll-slot-die { display: inline-flex; color: var(--red-text); animation: roll-spin 0.6s linear infinite; }
.roll-slot.is-still .roll-slot-die { animation: none; }
.roll-slot-die .icon { width: 28px; height: 28px; }
.roll-slot-text { display: flex; flex-direction: column; min-width: 0; }
.roll-slot-name { font-family: var(--font-ornate); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-slot-boss { font-size: var(--fs-sm); color: var(--text-2); }
.roll-slot.tick .roll-slot-text { animation: roll-tick 0.12s var(--ease); }
@keyframes roll-spin { to { transform: rotate(360deg); } }
@keyframes roll-tick { from { transform: translateY(-40%); opacity: 0.3; } to { transform: none; opacity: 1; } }

/* Cartão na página Jogador */
.roll-card .card-head { flex-wrap: wrap; }
.roll-open-page { gap: 6px; text-decoration: none; }

/* ---------- Histórico ---------- */
.roll-history-card .card-head { flex-wrap: wrap; }
.roll-history-tools { margin-left: auto; }
.roll-history-help { margin-bottom: var(--sp-3); }
.roll-history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.roll-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--sp-3);
  row-gap: 2px;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.roll-history-item:first-child { border-top: 0; }
.roll-history-name { overflow-wrap: anywhere; font-weight: 600; }
.roll-history-name a { color: var(--text); text-decoration: none; }
.roll-history-name a:hover { color: var(--red-text-hover); text-decoration: underline; }
.roll-history-boss { color: var(--text-2); font-weight: 400; }
.roll-history-meta { color: var(--text-2); text-align: right; white-space: nowrap; }
.roll-history-how { color: var(--ok); }
@media (max-width: 760px) {
  .roll-history-item { grid-template-columns: auto minmax(0, 1fr); }
  .roll-history-meta { grid-column: 2; text-align: left; white-space: normal; }
}

/* ---------- Chip flutuante "Task atual" ---------- */
.roll-chip {
  position: fixed;
  right: var(--sp-4);
  bottom: calc(var(--bottom-nav-h) + var(--sp-4));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: min(420px, calc(100vw - var(--sp-4) * 2));
  min-height: 44px;
  padding: 6px 16px 6px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
  text-decoration: none;
  animation: roll-chip-in 0.18s var(--ease);
}
.roll-chip:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); border-left-color: var(--red); }
.roll-chip > .icon { color: var(--red-text); }
.roll-chip-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.roll-chip-label { color: var(--text-2); font-weight: 600; }
.roll-chip-name { font-weight: 700; }
@keyframes roll-chip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* A barra "Desfazer" das ações em bloco fica por cima: o chip sobe */
body:has(.bulk-toast:not([hidden])) .roll-chip { bottom: calc(var(--bottom-nav-h) + var(--sp-4) + 64px); }
body:has(.roll-chip:not([hidden])) .site-footer { padding-bottom: calc(var(--sp-8) + var(--bottom-nav-h) + 64px); }
@media (max-width: 760px) {
  .roll-chip { right: var(--sp-3); left: var(--sp-3); bottom: calc(var(--bottom-nav-h) + var(--sp-2)); max-width: none; }
  body:has(.bulk-toast:not([hidden])) .roll-chip { bottom: calc(var(--bottom-nav-h) + var(--sp-4) + 104px); }
}

@media (prefers-reduced-motion: reduce) {
  .roll-task, .roll-offer, .roll-chip, .roll-slot-die, .roll-slot.tick .roll-slot-text, .roll-go[aria-busy="true"] .icon { animation: none; }
}
