/* -- Five Bones ------------------------------------------------- */

.fb-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fb-status {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  min-height: 2.8em;  /* two lines — prevents sticky section jumping height */
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* -- Dice area -------------------------------------------------- */


.fb-dice-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg-panel);
  padding: 0.75rem 0 1rem;
  margin: -0.5rem -1.5rem 0;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.fb-dice-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: center;
  max-width: 89vw;
}

.fb-die {
  position: relative;
  flex: 0 0 auto;
  width: clamp(44px, 15vw, 72px);
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 2px solid var(--color-border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Filled dice: no border or background until held */
.fb-die--filled {
  border-color: transparent;
  background: transparent;
}

.fb-die--holdable { cursor: pointer; }

/* Hover on a filled holdable die: subtle gold hint */
.fb-die--filled.fb-die--holdable:hover {
  border-color: rgba(232, 190, 142, 0.35);
}

/* Held die: always gold border regardless of fill state */
.fb-die--held {
  border-color: #e8be8e !important;
  background: rgba(232, 190, 142, 0.12);
}

.fb-die-empty {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.fb-die-held-label { display: none; }

.fb-die .gd-die-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  pointer-events: none;
}

.fb-dice-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.fb-rolls-left {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* -- Unified comparison table ----------------------------------- */

.fb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}

/* Category label gets ~40% of width, score columns share the rest equally */
.fb-col-cat    { width: 40%; }
.fb-col-player { width: 12%; text-align: center; }
.fb-col-npc    { width: 12%; text-align: center; }

/* Header row */
.fb-table thead th {
  padding: 0.4rem 0.25rem 0.5rem;
  text-align: center;
  vertical-align: bottom;
  border-bottom: 1px solid var(--color-border);
}

.fb-table thead th.fb-col-cat {
  text-align: left;
}

/* Avatar in header */
.fb-avatar {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.2rem;
  border: 1px solid var(--color-border);
}

.fb-avatar-placeholder {
  display: block;
  font-family: var(--font-heading);
  font-variant: small-caps;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Section divider */
.fb-section-head td {
  padding: 0.5rem 0.25rem 0.2rem;
  font-family: var(--font-heading);
  font-variant: small-caps;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

/* Category rows */
.fb-row td {
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.fb-row--open:hover {
  background: rgba(232, 190, 142, 0.04);
}

.fb-row--scored {
  opacity: 0.55;
}

/* Category label column */
.fb-row-label {
  text-align: left;
  padding-right: 0.5rem;
}

.fb-cat-name {
  display: block;
  font-family: var(--font-heading);
  font-variant: small-caps;
  font-size: 0.82rem;
  color: var(--color-text-heading);
  letter-spacing: 0.02em;
}

.fb-cat-hint {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 0.05rem;
}

/* Score cells */
.fb-score {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  white-space: nowrap;
}

.fb-score--filled {
  color: #e8be8e;
  font-weight: 700;
  font-size: 0.95rem;
}

.fb-score--npc.fb-score--filled {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.fb-score--empty   { color: rgba(255, 255, 255, 0.15); }
.fb-score--bonus   { color: #7ab8d4; font-weight: 700; }
.fb-score--progress { color: var(--color-text-muted); font-size: 0.72rem; }

.fb-score--preview {
  color: rgba(232, 190, 142, 0.5);
  font-style: italic;
}

.fb-score--clickable {
  cursor: pointer;
  transition: color 0.1s;
}

.fb-score--clickable:hover {
  color: #e8be8e;
}

/* Joker scoring */
.fb-score--joker {
  color: #7ab8d4;
  font-style: italic;
  cursor: pointer;
}

.fb-score--joker:hover { color: #a8d8f0; }

.fb-score--locked {
  color: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.fb-row--joker-avail {
  background: rgba(122, 184, 212, 0.06);
}

.fb-row--joker-avail .fb-cat-name {
  color: #7ab8d4;
}

.fb-row--joker-locked {
  opacity: 0.3;
}

/* Bonus row */
.fb-row--bonus td {
  border-top: none;
  background: rgba(255, 255, 255, 0.02);
}

/* Total row */
.fb-row--total td {
  border-top: 2px solid var(--color-border);
  padding-top: 0.5rem;
}

.fb-score--total {
  font-size: 1rem;
  font-weight: 700;
  color: #e8be8e;
}

.fb-score--npc.fb-score--total {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
