/* Boss page: "next boss" banner (components/nextUp.js), toolbar + count line (bossToolbar.js), grid,
   ⋯ menu (popMenu.js). Design by GPT (GPT/boss-cards.css, GPT/demo.css) on the dark theme. Colours: theme.css */

/* ---- the next boss: the one large thing on the page ----
   no scenery behind it (ผู้ใช้ 22 พ.ย. 69: ฉากซากปราสาท "ลายตา" — เอาออกทั้งในการ์ดและแถบนี้) */
.next {
  --state: var(--wait);
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(210px, auto);
  align-items: center;
  gap: 20px;
  min-width: 0;
  margin-bottom: 23px;
  padding: 16px 22px;
  border: 1px solid transparent;
  border-radius: 20px 24px 24px 20px;
  background: var(--banner-grad) padding-box, var(--banner-frame) border-box;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--gold) 55%, transparent), inset 0 0 0 5px rgba(0, 0, 0, 0.35), 0 6px 24px rgba(0, 0, 0, 0.55);
}
.next.is-window { --state: var(--window); }
.next::after {    /* glint on the top edge */
  content: '';
  position: absolute;
  top: -1px;
  right: 8%;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent);
  pointer-events: none;
}
.next-medal { width: 84px; height: 84px; }
.next-medal::before, .next-medal::after {   /* gold diamonds above and below the portrait */
  content: '';
  position: absolute;
  left: calc(50% - 4px);
  width: 8px;
  height: 13px;
  background: linear-gradient(100deg, var(--accent), var(--gold-light), var(--gold));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  filter: drop-shadow(0 0 3px var(--gold));
}
.next-medal::before { top: -8px; }
.next-medal::after { bottom: -8px; }
.next-img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }
.next-body { min-width: 0; }
.next-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  font-size: 12px;
  font-weight: 600;
  color: var(--state);
}
.next-label::before { content: '✦'; font-size: 13px; }
.next-name { margin: 0; font: 600 clamp(18px, 2.2vw, 26px)/1.25 var(--font-display); letter-spacing: 0.01em; color: var(--gold-light); overflow-wrap: anywhere; text-wrap: balance; }
.next-map { display: flex; align-items: center; gap: 12px; margin-top: 5px; font-size: 13px; color: var(--text-2); }
.next-map::after { content: ''; flex: 1; max-width: 180px; height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }
.next-side {   /* the countdown in its own gold-edged frame */
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 89px;
  margin: -8px -14px -8px 0;
  padding: 12px 20px 12px 25px;
  border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line));
  border-left-color: color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 20px 18px 18px 6px;
  background: var(--side-grad);
  text-align: center;
}
.next-side::before { content: '◇'; position: absolute; left: -8px; top: calc(50% - 13px); font: 22px/1 Georgia, serif; color: var(--gold-light); text-shadow: 0 0 7px var(--gold); }
.next-clock {
  font: 600 44px/1.1 var(--font-display);
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: var(--state);
  text-shadow: 0 0 22px color-mix(in srgb, var(--state) var(--glow), transparent);
}
.next-when { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--text-2); }

/* ---- toolbar: tabs, search, sort ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tabs { display: flex; align-self: stretch; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 9px 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-2);
}
.tab:hover { color: var(--gold-light); }
.tab.is-active { color: var(--gold); border-bottom-color: var(--accent); }
.toolbar-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 265px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line-hi);
  border-radius: 7px;
  background: var(--field);
}
.search-field:focus-within { border-color: var(--accent); }
.search-field img { flex-shrink: 0; }
.search-field input { width: 100%; min-width: 0; padding: 10px 0; border: 0; background: transparent; font-size: 13px; outline: none; }
.search-field input::placeholder { color: var(--text-3); }
.toolbar-sort { width: auto; padding-top: 9px; padding-bottom: 9px; font-size: 13px; border-radius: 7px; }

.board-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin: 15px 0 10px; font-size: 12px; color: var(--text-2); }
.board-meta-left, .board-meta-right { display: flex; gap: 14px; align-items: center; }
.board-owner { color: inherit; text-decoration: none; }
.board-owner:hover { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
/* live updates on (teal, the "may be up" colour) / off (grey) */
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live.is-on { color: var(--window); }
.live.is-on::before { box-shadow: 0 0 6px var(--window); }
/* Discord alerts: on (gold) / not set or off (grey) / broken (red) — links to /settings */
.board-alert { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); text-decoration: none; }
.board-alert img { opacity: 0.55; }
.board-alert:hover { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
.board-alert.is-on { color: var(--gold); }
.board-alert.is-on img, .board-alert.is-bad img, .board-alert:hover img { opacity: 1; }
.board-alert.is-bad { color: var(--up); }

.grid-hint { margin: -2px 0 10px; font-size: 13px; color: var(--accent-text); }   /* "เรียงเอง": how to move cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; align-items: stretch; }

/* ---- ⋯ menu ---- */
.pop-menu {
  position: absolute;
  z-index: 30;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--surface-hi);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.pop-item { text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 12px; }
.pop-item:hover, .pop-item:focus-visible { background: var(--line); }
.pop-item.is-danger { color: var(--up); }

.tomb-input { font-family: var(--font-display); font-size: 28px; text-align: center; letter-spacing: 0.1em; }

@media (max-width: 720px) {
  .next { grid-template-columns: 60px minmax(0, 1fr); gap: 13px 15px; padding: 17px; border-radius: 17px; }
  .next-medal { width: 60px; height: 60px; }
  .next-img { width: 50px; height: 50px; }
  .next-name { font-size: 20px; }
  .next-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 61px; margin: 0 -8px -8px; padding: 10px 14px; border-radius: 10px; text-align: right; }
  .next-side::before { display: none; }
  .next-clock { font-size: 34px; flex-shrink: 0; }
  .next-when { margin-top: 0; max-width: 48%; }
}
@media (max-width: 600px) {
  .toolbar { flex-wrap: wrap; gap: 12px; }
  .toolbar-tools { width: 100%; }
  .search-field { flex: 1; width: auto; }
}
/* avoid one oversized card just above the phone breakpoint */
@media (min-width: 521px) and (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 9px 12px; }
  .search-field input { font-size: 16px; padding: 9px 0; }   /* 16px: phones don't zoom into the field */
}
@media (max-width: 360px) {
  .next-name { font-size: 18px; }
  .next-clock { font-size: 30px; }
}
