/* Panels: windows, ribbon headings, plates, list rows, Today cards, the navi speech box, stat lines. */

/* ---------------------------------------------------------------- windows (list_frame5 gold rim, challeng_navi_window navy) */
.bfc-window {
  position: relative; padding: 4px 6px;
  border-style: solid; border-color: transparent; border-width: 12px;
  border-image: url(../assets/ui/frame-gold.png) 16 fill / 12px stretch;
  /* the frame's centre is see-through: back body text so it never sits on the busy pane art */
  background: rgba(4, 10, 30, .78); background-clip: padding-box;
}
.bfc-window--navy { border-image-source: url(../assets/ui/window-navy.png); border-image-slice: 14 fill; border-width: 10px; }
.bfc-window__title { margin: 0 0 8px; font: 800 var(--bfc-fs-h)/1.2 var(--bfc-font-game); color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline); }

/* ribbon heading: a gold rule either side, like the game's headline plates */
.bfc-ribbon {
  display: flex; align-items: center; gap: 10px; margin: 18px 2px 10px;
  font: 800 var(--bfc-fs-h)/1.2 var(--bfc-font-game); color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline);
}
.bfc-ribbon::before, .bfc-ribbon::after { content: ""; height: 2px; flex: 1; background: linear-gradient(90deg, transparent, var(--bfc-gold-2) 40%, var(--bfc-gold-1)); }
.bfc-ribbon::after { background: linear-gradient(270deg, transparent, var(--bfc-gold-2) 40%, var(--bfc-gold-1)); }
.bfc-ribbon:first-child { margin-top: 6px; }

/* name plate (handle_name_frame): a 9-slice, so the spiked ends keep their shape and the frame grows with the name */
.bfc-nameplate {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; max-width: 100%;
  min-width: 170px; height: 36px; padding: 0 6px;
  border-style: solid; border-color: transparent; border-width: 0 29px;
  border-image: url(../assets/ui/name-frame.png) 0 56 fill / 0 29px stretch;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
.bfc-nameplate b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 17px/1.15 var(--bfc-font-game); color: #fff; text-shadow: var(--bfc-outline); }
.bfc-nameplate small { flex: none; font: 800 11px/1 var(--bfc-font-game); color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline-thin); }

/* ---------------------------------------------------------------- list rows (unit_common_plate stone row) */
.bfc-rows { display: grid; gap: 8px; list-style: none; }
.bfc-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: var(--bfc-tile-pad); text-decoration: none; color: inherit; text-align: left; border: 0; cursor: default;
  background: #2c353f url(../assets/ui/plate-row.webp) left center / 100% 100% no-repeat;
  border-radius: 6px; box-shadow: 0 2px 0 #000;
  transition: filter .15s, transform var(--bfc-dur-fast);
}
a.bfc-row, button.bfc-row { cursor: pointer; }
a.bfc-row:hover, button.bfc-row:hover { filter: brightness(1.18); }
a.bfc-row:active, button.bfc-row:active { transform: translateY(1px); }
.bfc-row__text { flex: 1; min-width: 0; }
.bfc-row__kicker { display: block; font: 800 var(--bfc-fs-kicker)/1.3 var(--bfc-font-game); letter-spacing: .08em; text-transform: uppercase; color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline-thin); }
.bfc-row__title { display: block; font: 800 var(--bfc-fs-title)/1.25 var(--bfc-font-game); color: #fff; text-shadow: var(--bfc-outline); }
.bfc-row__sub { display: block; margin-top: 2px; font-size: var(--bfc-fs-s); line-height: 1.35; color: var(--bfc-ink-soft); text-shadow: 0 1px 0 #000; }
.bfc-row__chev { flex: none; width: 14px; height: 28px; background: url(../assets/ui/arrow-r.png) center / contain no-repeat; }
.bfc-row__num {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font: 800 15px/1 var(--bfc-font-game); text-shadow: var(--bfc-outline);
  background: radial-gradient(circle at 35% 30%, #fff1b0, var(--bfc-gold-2) 50%, var(--bfc-gold-4)); box-shadow: 0 0 0 2px #000;
}
.bfc-row.is-done { opacity: .66; }
.bfc-row.is-done .bfc-row__num { background: radial-gradient(circle at 40% 30%, #b8ff9a, #2a9a10 55%, #0d4a00); }

/* ---------------------------------------------------------------- Today card (home mini banner + corner brackets) */
.bfc-card {
  position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 78px; padding: 8px 12px 8px 8px; text-decoration: none; color: inherit; overflow: hidden;
  background: linear-gradient(100deg, rgba(10, 20, 52, .97), rgba(16, 32, 82, .93) 60%, rgba(10, 20, 52, .97));
  border: 2px solid #000; border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--bfc-gold-2), inset 0 0 0 3px #000, 0 3px 0 rgba(0, 0, 0, .6);
  transition: filter .15s, transform var(--bfc-dur-fast);
}
a.bfc-card:hover { filter: brightness(1.15); }
a.bfc-card:active { transform: translateY(1px); }
.bfc-card__pic { position: relative; height: 62px; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(214, 164, 62, .7); background: #0b1634; }
.bfc-card__pic > img { width: 100%; height: 100%; object-fit: cover; }
.bfc-card__pic--duo { display: flex; align-items: center; justify-content: center; }
.bfc-card__pic--duo img { width: 38px; height: 38px; object-fit: contain; }
.bfc-card__pic--duo i { width: 10px; height: 18px; background: url(../assets/ui/arrow-r.png) center / contain no-repeat; }
.bfc-card__pic--icon { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, #26408a, #0b1634 70%); }
.bfc-card__pic--icon img { width: 94%; height: 86%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.bfc-card__kicker { display: block; font: 800 var(--bfc-fs-kicker)/1.3 var(--bfc-font-game); letter-spacing: .08em; text-transform: uppercase; color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline-thin); }
.bfc-card__title { display: block; margin: 1px 0 2px; font: 800 var(--bfc-fs-title)/1.25 var(--bfc-font-game); text-shadow: var(--bfc-outline); }
.bfc-card__sub { display: block; font-size: var(--bfc-fs-s); line-height: 1.35; color: var(--bfc-ink-soft); text-shadow: 0 1px 0 #000; }
.bfc-card__go { width: 14px; height: 28px; background: url(../assets/ui/arrow-r.png) center / contain no-repeat; }
.bfc-card__new { position: absolute; right: 6px; top: 4px; width: 46px; height: 20px; background: url(../assets/ui/new.png) center / contain no-repeat; animation: bfc-bob 1.6s ease-in-out infinite; }
@keyframes bfc-bob { 50% { transform: translateY(-3px); } }
@media (max-width: 419.98px) { .bfc-card { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; } .bfc-card__pic { height: 58px; } }

/* ---------------------------------------------------------------- navi speech box (the Hall clerk) */
.bfc-navi {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 8px 10px 10px;
  border-style: solid; border-color: transparent; border-width: 12px;
  border-image: url(../assets/ui/frame-navi.png) 40 fill / 12px stretch;
}
.bfc-navi__face { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; background: var(--bfc-navy-2); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--bfc-gold-3), 0 0 0 5px #000; }
.bfc-navi__who { margin: 2px 0 5px; font: 800 11.5px/1 var(--bfc-font-game); letter-spacing: .1em; text-transform: uppercase; color: var(--bfc-gold-1); text-shadow: var(--bfc-outline-thin); }
.bfc-navi__say { font-size: var(--bfc-fs-m); line-height: 1.45; color: #fff; text-shadow: 0 1px 0 #000; }
.bfc-navi__say b { color: var(--bfc-gold-1); }
.bfc-navi__say::after { content: "\25BC"; display: inline-block; margin-left: 6px; font-size: 10px; color: var(--bfc-gold-2); animation: bfc-blink 1s steps(2) infinite; }
@keyframes bfc-blink { 50% { opacity: 0; } }
/* standing variant: the full character beside the box (wide panes) */
.bfc-navi-stand { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
.bfc-navi-stand__art { display: none; }
@container pane (min-width: 640px) {
  /* the clerk stands beside her box, the box at her shoulder height, so no empty band opens above the box */
  .bfc-navi-stand { grid-template-columns: minmax(0, 1fr) 170px; gap: 0; align-items: center; }
  .bfc-navi-stand__art { display: block; width: 170px; height: 220px; object-fit: contain; object-position: 50% 0; margin: -8px 0 -16px -20px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); pointer-events: none; }
  .bfc-navi-stand .bfc-navi { margin-right: -30px; }
}

/* ---------------------------------------------------------------- stat line (unit_explanation frame) */
.bfc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bfc-tile-gap); }
.bfc-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 12px; border-radius: var(--bfc-tile-radius); background: linear-gradient(#13234d, #091330); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px #000; }
.bfc-stat dt { font: 800 var(--bfc-fs-label)/1.2 var(--bfc-font-game); color: var(--bfc-ink-gold); text-shadow: var(--bfc-outline-thin); }
.bfc-stat dd { margin: 0; font-size: var(--bfc-fs-value); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bfc-stat--wide { grid-column: 1 / -1; }

/* key/value list (account) */
.bfc-kv { display: grid; gap: var(--bfc-tile-gap); }
.bfc-kv > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: var(--bfc-tile-radius); background: rgba(3, 8, 24, .72); box-shadow: inset 0 0 0 1px rgba(214, 164, 62, .3); }
.bfc-kv dt { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--bfc-fs-s); color: var(--bfc-ink-soft); }
.bfc-kv dt img { width: 26px; height: 26px; object-fit: contain; }
.bfc-kv dd { flex: none; margin: 0; font-size: var(--bfc-fs-value); font-variant-numeric: tabular-nums; text-align: right; }
