/* css/boss.css - the World Boss page, header pill and notification (docs/PLAN-BOSS.md). */

/* ------------------------------------------------------------------------ */
/* Header pill (§3.2, picture 05): grey during the day, red in the lobby,    */
/* gold while it fights and while your catch waits                           */
/* ------------------------------------------------------------------------ */

.boss-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px 2px 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: var(--panel-border);
  color: var(--muted); font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.boss-pill[hidden] { display: none; }
.boss-pill:hover, .boss-pill:focus-visible { color: var(--text); text-decoration: none; }
.boss-pill-img { width: 26px; height: 26px; margin: -5px 0; object-fit: contain; image-rendering: pixelated; }
.boss-pill b { font-variant-numeric: tabular-nums; }
.boss-pill .bp-short { display: none; }
.boss-pill.lobby {
  color: #fff; border-color: rgba(255, 150, 150, 0.6);
  background: linear-gradient(180deg, #d64545, #a02626);
  box-shadow: 0 0 12px rgba(214, 69, 69, 0.5);
}
.boss-pill.live, .boss-pill.catch {
  color: #3a2a05; border-color: rgba(255, 236, 170, 0.9);
  background: linear-gradient(180deg, #ffe28a, #f0b43c);
  box-shadow: 0 0 12px rgba(255, 200, 80, 0.5);
}
.boss-pill.lobby:hover, .boss-pill.lobby:focus-visible { color: #fff; }
.boss-pill.live:hover, .boss-pill.catch:hover { color: #1e1400; }

/* The menu tag behind "World Boss" (js/ui/layout.js). */
.tag.boss-tag.hot { background: rgba(214, 69, 69, 0.22); color: #ffb3b3; }
.tag.boss-tag.live { background: rgba(255, 214, 102, 0.24); color: #ffe28a; font-weight: 800; }

/* ------------------------------------------------------------------------ */
/* Notification card + toast (§3.2, pictures 05 / 05b): the boss's sprite    */
/* ------------------------------------------------------------------------ */

.notif-item.boss-notif {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 8px; align-items: center;
  border: 1px solid rgba(214, 69, 69, 0.55); border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, rgba(64, 18, 28, 0.85), rgba(34, 14, 24, 0.85));
}
.notif-item.boss-notif.k-catch { border-color: rgba(255, 214, 102, 0.6); border-left-color: #f0b43c; background: linear-gradient(180deg, rgba(58, 44, 14, 0.85), rgba(30, 24, 12, 0.85)); }
.boss-notif-art { grid-row: span 2; display: flex; justify-content: center; }
.boss-notif-img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(255, 200, 120, 0.45)); }
.boss-notif-body { min-width: 0; font-size: 0.78rem; line-height: 1.3; }
.boss-notif-title { display: block; font-size: 0.86rem; color: #fff; }
.boss-notif-line { color: #ffc2c2; }
.boss-notif-line b { color: #fff; font-variant-numeric: tabular-nums; }
.k-catch .boss-notif-line { color: #ffe28a; }
.boss-notif-small { font-size: 0.68rem; color: var(--muted); }
.notif-item.boss-notif .actions { grid-column: 2; }

.toast.boss-toast { border-left-color: #f0b43c; }
/* The text shares the first row with the sprite, also on a phone where the invite toast wraps. */
.toast.boss-toast .toast-text { flex: 1 1 0; min-width: 0; }
.boss-toast-img { flex: none; width: 44px; height: 44px; margin: -6px 0; object-fit: contain; image-rendering: pixelated; }

/* ------------------------------------------------------------------------ */
/* The chat line (§3.2, picture 05): gold, the boss's sprite, a link         */
/* ------------------------------------------------------------------------ */

.chat-msg.boss-line {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0; padding: 6px 8px; border-radius: 8px;
  border: 1px solid rgba(255, 214, 102, 0.55);
  background: linear-gradient(180deg, rgba(58, 44, 14, 0.7), rgba(30, 24, 12, 0.7));
  font-style: normal;
}
.chat-msg.boss-line:hover { background: linear-gradient(180deg, rgba(70, 54, 18, 0.8), rgba(36, 28, 14, 0.8)); }
.boss-line-img { flex: none; width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.boss-line-body { min-width: 0; }
.boss-line-text { display: block; color: #ffe28a; font-size: 0.78rem; line-height: 1.3; }
.boss-line-meta { font-size: 0.66rem; color: var(--muted); margin-top: 1px; }
.boss-line-meta small { opacity: 0.8; }
.boss-line-meta a { color: #ffe28a; font-weight: 600; }

/* ------------------------------------------------------------------------ */
/* The #boss page (§3.3, pictures 07c / 07b / 11 / 11b)                      */
/* ------------------------------------------------------------------------ */

.wb-page { display: flex; flex-direction: column; gap: 12px; }

/* The hero: the boss big on a Dungeon arena, the clock and the one button on the left. */
.wb-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 32%);
  grid-template-areas: "top art" "rest art"; grid-template-rows: auto 1fr; column-gap: 12px; align-items: start;
  padding: 18px 22px 20px; border-radius: 14px;
  background: #150f22 var(--wb-image) center 55% / cover no-repeat;
  border: 1px solid rgba(255, 214, 102, 0.35); box-shadow: var(--shadow);
}
.wb-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 8, 22, 0.94) 38%, rgba(30, 8, 28, 0.35)),
    radial-gradient(ellipse 30% 55% at 80% 50%, rgba(255, 120, 80, 0.25), transparent 70%);
}
.wb-hero.s-fighting { border-color: rgba(255, 214, 102, 0.7); }
.wb-hero.s-failed .wb-hero-art { filter: grayscale(0.6) brightness(0.75); }
.wb-hero-top { grid-area: top; min-width: 0; }
.wb-hero-rest { grid-area: rest; min-width: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.wb-hero-art { grid-area: art; align-self: center; justify-self: center; filter: drop-shadow(0 0 18px rgba(255, 200, 120, 0.55)); }
.wb-hero-img { display: block; width: 200px; height: 200px; object-fit: contain; image-rendering: pixelated; }
.wb-hero.s-won .wb-hero-art { filter: drop-shadow(0 0 10px rgba(255, 200, 120, 0.4)) brightness(0.85) saturate(0.85); }

.wb-kicker {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; white-space: nowrap;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: linear-gradient(180deg, #e04848, #9e2424);
}
.wb-kicker small { font-size: 0.62rem; font-weight: 600; letter-spacing: 0; opacity: 0.8; text-transform: none; }
.wb-kicker.live { color: #3a2a05; background: linear-gradient(180deg, #ffe28a, #f0b43c); }
.wb-kicker.won { color: #d7ffe0; background: rgba(76, 217, 100, 0.28); }
.wb-kicker.failed { color: var(--text); background: rgba(255, 255, 255, 0.16); }
.wb-name { margin: 6px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 1.9rem; line-height: 1.15; }
.wb-types { display: inline-flex; gap: 4px; font-size: 0.8rem; }
.wb-big { font-size: 2.9rem; font-weight: 900; line-height: 1; margin-top: 8px; color: #ffe28a; font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(255, 200, 80, 0.55); }
.wb-big small { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-shadow: none; }
.wb-when { font-size: 0.85rem; color: #d3d8e6; }
.wb-when b { color: #ffe28a; font-variant-numeric: tabular-nums; }
.wb-blurb { margin: 0; font-size: 0.85rem; color: #e6ebf5; max-width: 560px; }
.wb-times { font-size: 0.8rem; color: var(--muted); }
.wb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wb-chip { font-size: 0.72rem; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.wb-chip.gold { background: rgba(255, 214, 102, 0.2); color: #ffe28a; font-weight: 700; }

.wb-actions-wrap { display: flex; flex-direction: column; gap: 6px; }
.wb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wb-go { min-width: 220px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.wb-go:disabled { opacity: 0.55; box-shadow: none; }
.wb-catch { box-shadow: 0 0 0 2px rgba(255, 214, 102, 0.45), 0 0 22px rgba(255, 200, 80, 0.35); }
.wb-btn-clock { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 0.85; }
.wb-in { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 10px; font-weight: 700; color: #9df0ab; background: rgba(76, 217, 100, 0.14); border: 1px solid rgba(157, 240, 171, 0.35); }
.wb-note { font-size: 0.8rem; color: #d3d8e6; }
.wb-note b { color: #ffe28a; font-variant-numeric: tabular-nums; }
.wb-note.ok { color: #9df0ab; display: inline-flex; align-items: center; gap: 4px; }
.wb-why { font-size: 0.8rem; color: #ffb3b3; display: inline-flex; align-items: center; gap: 4px; }

/* The shared bar in points (§3.5); LAST PUSH under 10 %: red and thicker (contract, round 1). */
.wb-pot-head { display: flex; align-items: baseline; gap: 8px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.wb-pot-pct { margin-left: auto; font-weight: 800; color: #ffe28a; }
.wb-pot-track { position: relative; height: 14px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: var(--hp-track); box-shadow: 0 0 0 1px rgba(255, 214, 102, 0.5); }
.wb-pot-fill { height: 100%; background: linear-gradient(90deg, #7b5cff, #b18cff); transition: width 0.6s ease; }
.wb-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(8, 10, 22, 0.7); }
.wb-pot.push .wb-pot-track { height: 20px; box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.8), 0 0 14px rgba(229, 72, 77, 0.55); }
.wb-pot.push .wb-pot-fill { background: linear-gradient(90deg, #e5484d, #ff8a7a); }
.wb-pot.push .wb-pot-pct { color: #ff9a9d; }
.wb-push { font-weight: 900; letter-spacing: 0.04em; color: #ff9a9d; }
.wb-you-line { font-size: 0.85rem; color: #d3d8e6; }
.wb-you-line b { color: #9df0ab; }

.wb-kept { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255, 214, 102, 0.45); background: rgba(255, 214, 102, 0.07); font-size: 0.85rem; }
.wb-kept-num { font-size: 1.7rem; font-weight: 900; color: #ffe28a; font-variant-numeric: tabular-nums; }
.wb-kept-sub { font-size: 0.75rem; color: var(--muted); }
.wb-next { font-size: 0.8rem; color: var(--muted); }
.wb-next b { color: var(--text); }

/* The two columns under the hero: they sit side by side once both get 380 px. */
.wb-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; }
.wb-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wb-panel { padding: 12px 14px; }
.wb-panel-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.wb-panel-right { margin-left: auto; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
.wb-empty { font-size: 0.82rem; color: var(--muted); }

/* In the lobby: a tile per trainer, their lead on their shoulder, level and bonus. */
.wb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.wb-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 5px; border-radius: 10px; font-size: 0.72rem; min-width: 0; }
.wb-tile.me { background: rgba(157, 240, 171, 0.12); outline: 1px solid rgba(157, 240, 171, 0.35); }
.wb-tile.more { justify-content: center; font-size: 0.95rem; font-weight: 800; color: #ffe28a; }
.wb-tile-art { position: relative; }
.wb-lead { position: absolute; right: -12px; bottom: -4px; width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.wb-tile-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.wb-tile.me .wb-tile-name { color: #9df0ab; }
.wb-tile-lv { color: var(--muted); }
.wb-tile-f { color: #ffe28a; font-weight: 800; }
.wb-you { position: absolute; top: 2px; right: 3px; padding: 0 5px; border-radius: 4px; font-size: 0.58rem; font-weight: 900; background: rgba(157, 240, 171, 0.25); color: #9df0ab; }

/* The top of the fight and the boards: rank, avatar, name, points, a bar against #1. */
.wb-ranks, .wb-board-rows { display: flex; flex-direction: column; gap: 3px; }
.wb-rank {
  display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto; grid-template-areas: "no av name pts" "no av bar bar";
  align-items: center; gap: 1px 8px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 0.82rem;
}
.wb-rank > .wb-rank-no { grid-area: no; }
.wb-rank > .avatar { grid-area: av; }
.wb-rank-name { grid-area: name; min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; }
.wb-rank-name b { overflow: hidden; text-overflow: ellipsis; }
.wb-rank-you { color: var(--muted); font-size: 0.75rem; }
.wb-rank-lead { width: 26px; height: 26px; margin: -6px 0; object-fit: contain; image-rendering: pixelated; flex: none; }
.wb-rank-lv { color: var(--muted); font-size: 0.72rem; }
.wb-rank-out { font-size: 0.6rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 5px; border-radius: 4px; background: rgba(214, 69, 69, 0.2); color: #ffb3b3; }
.wb-rank-pts { grid-area: pts; color: #ffe28a; font-variant-numeric: tabular-nums; }
.wb-rank-bar { grid-area: bar; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wb-rank-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0b43c, #ffe28a); }
.wb-rank.me { background: rgba(157, 240, 171, 0.1); outline: 1px solid rgba(157, 240, 171, 0.3); }
.wb-rank.me .wb-rank-name b { color: #9df0ab; }
.wb-rank.me .wb-rank-fill { background: linear-gradient(90deg, #4fbf6a, #9df0ab); }
.wb-rank.s-out { opacity: 0.65; }
.wb-rank.s-out .avatar { filter: grayscale(1); }
.wb-rank-more { font-size: 0.75rem; color: var(--muted); padding: 2px 8px; }
.wb-rank-no { text-align: center; font-weight: 800; color: var(--muted); display: inline-flex; justify-content: center; }
.wb-crown { display: inline-flex; color: #ffd24a; filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.7)); }

.wb-board-row { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 0.82rem; }
.wb-board-row.short { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
.wb-board-row.me { background: rgba(157, 240, 171, 0.1); }
.wb-board-row.me .wb-board-name { color: #9df0ab; }
.wb-board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-board-bosses { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.wb-board-pts { color: #ffe28a; font-variant-numeric: tabular-nums; text-align: right; min-width: 3.5em; }
.wb-board-you { margin-top: 8px; font-size: 0.82rem; }
.wb-board-you b { color: #9df0ab; }

.wb-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wb-step { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.78rem; color: #d3d8e6; }
.wb-step b { color: var(--text); font-size: 0.85rem; }

/* Coming up: the next bosses with their time. */
.wb-sched-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 2px 4px; font-size: 0.82rem; }
.wb-sched-row + .wb-sched-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.wb-sched-img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.wb-sched-name { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.wb-sched-when { text-align: right; font-variant-numeric: tabular-nums; }
.wb-sched-when small { display: block; font-size: 0.68rem; color: var(--muted); }

.wb-last-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wb-last-img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; flex: none; }
.wb-last-name { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.wb-last-count { font-size: 0.78rem; color: var(--muted); }
.wb-last .wb-board-row + .wb-board-row { margin-top: 3px; }

@media (max-width: 600px) {
  /* The header (picture 05b): from the lobby until your catch is over, the boss chip takes the place of
     "41 online"; the rest of the day the header stays as it is and the time is the menu tag. */
  .boss-pill { padding: 2px 8px 2px 2px; font-size: 0.72rem; }
  .boss-pill.idle { display: none; }
  .boss-pill .bp-long { display: none; }
  .boss-pill .bp-short { display: inline; }
  .boss-pill-img { width: 22px; height: 22px; }
  #topbar.boss-hot .online-pill { display: none; }
}
@media (max-width: 379px) {
  /* 360 px phones (bug round 28 September, WB-21): logo, pill, flag, avatar and the party button did not fit on
     one row, the pill slid under the flag and its clock read "29:5…" or "LI". The pill goes smaller and the
     language flag steps aside while a boss is on - the flag is in the menu as well. */
  .boss-pill { padding: 2px 5px 2px 2px; gap: 3px; font-size: 0.66rem; }
  .boss-pill-img { width: 18px; height: 18px; margin: -3px 0; }
  #topbar.boss-hot .lang-btn { display: none; }

  /* The page (picture 07b): the boss top right, the clock and the button full width under it. */
  .wb-hero { grid-template-columns: minmax(0, 1fr) 112px; grid-template-areas: "top art" "rest rest"; padding: 14px; column-gap: 8px; }
  .wb-hero-img { width: 112px; height: 112px; }
  .wb-name { font-size: 1.5rem; }
  .wb-big { font-size: 2.3rem; }
  .wb-go { flex: 1 1 100%; min-width: 0; }
  .wb-panel { padding: 10px 12px; }
  .wb-steps { grid-template-columns: minmax(0, 1fr); }
  .wb-tiles { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .wb-board-bosses { display: none; }
  .wb-board-row { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-pot-fill { transition: none; }
}
