/* Boss card (components/bossCard.js) — design by GPT (GPT/boss-cards.css) moved onto the dark theme:
   black panel in a gold frame, gold-ringed medallion, countdown glowing in the state colour.
   No pictures or light bands inside the card (ผู้ใช้ 22 พ.ย. 69: ฉากพีระมิด/ปราสาทในการ์ด "ลายตา" — เอาออก).
   --state: --wait รอเกิด · --window อาจเกิดแล้ว · --up เกิดแล้ว. Colours: theme.css */
.card {
  --state: var(--text-3);
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas: 'medal head' 'time time' 'fuse fuse' 'when when' 'acts acts';
  column-gap: 12px;
  padding: 16px 14px 14px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  background: var(--card-grad) padding-box, var(--frame-grad) border-box;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 207, 0.04), inset 0 1px 9px color-mix(in srgb, var(--gold) 6%, transparent), 0 5px 15px rgba(0, 0, 0, 0.45);
}
.card.is-wait { --state: var(--wait); }
.card.is-window { --state: var(--window); }
.card.is-up { --state: var(--up); }
/* may be up / is up: a halo in the state colour, so these cards are found at a glance */
.card.is-window, .card.is-up {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state) 35%, transparent), 0 0 18px color-mix(in srgb, var(--state) 16%, transparent), 0 5px 15px rgba(0, 0, 0, 0.45);
}

/* a glint of light on the top edge; pinned: a gold seal there instead */
.card::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 12%;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 45%, transparent);
  pointer-events: none;
}
.card.is-pinned::after { left: 14px; width: 20px; height: 5px; background: var(--gold); box-shadow: none; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 65%, 0 100%); }

/* medallion (shared with the "next boss" banner) */
.card-medal, .next-medal {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--medal-bg) padding-box, var(--medal-ring) border-box;
  box-shadow: inset 0 0 0 2px var(--panel-deep), 0 0 0 1px color-mix(in srgb, var(--gold) 15%, transparent), 0 0 12px color-mix(in srgb, var(--gold) 8%, transparent);
}
.card-medal { grid-area: medal; width: 56px; height: 56px; overflow: hidden; }
.card-img { width: 46px; height: 46px; object-fit: contain; image-rendering: pixelated; }
.card-img.is-empty { display: grid; place-items: center; font: 600 24px var(--font-display); color: var(--gold); }

.card-head { grid-area: head; display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.card-title { flex: 1; min-width: 0; padding-top: 3px; }
.card-name {
  margin: 0;
  font: 700 15px/1.28 var(--font-display);
  letter-spacing: 0.015em;
  color: var(--gold-light);
  text-shadow: 0 1px 8px color-mix(in srgb, var(--gold) 10%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card-count { color: var(--text-2); font-weight: 400; }
.card-map { margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-menu {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 28px;
  margin: -2px -3px 0 0;
  padding: 0 0 5px;
  border: 1px solid var(--chip-edge);
  border-radius: 6px;
  background: var(--chip-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 700 20px/1 var(--font-body);
}
.card-menu:hover { background: var(--surface-hi); border-color: var(--line-hi); }

/* "เรียงเอง" (components/cardDrag.js): a ⠿ handle beside ⋯ ; the card being moved lifts in a gold outline */
.card-drag { display: none; }
.grid.is-ordering .card-drag {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 28px;
  margin: -2px 0 0;
  padding: 0;
  border: 1px solid var(--chip-edge);
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--gold-light);
  font: 700 16px/1 var(--font-body);
  cursor: grab;
  touch-action: none;   /* dragging the handle never scrolls the page */
}
.grid.is-dragging, .grid.is-dragging * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.card.is-dragging { z-index: 2; opacity: 0.9; outline: 2px solid var(--accent); outline-offset: 3px; transform: scale(1.02); }

/* countdown */
.card-time { grid-area: time; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 15px; min-height: 31px; }
.card-clock {
  font: 600 27px/1.1 var(--font-display);
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--state);
  text-shadow: 0 0 16px color-mix(in srgb, var(--state) var(--glow), transparent);
}
.card-clock .d, .next-clock .d { display: inline-block; width: 0.65em; text-align: center; }   /* fixed widths: no jitter */
.card-clock .c, .next-clock .c { display: inline-block; width: 0.27em; text-align: center; }
.card-status { font-size: 12px; line-height: 1.5; color: var(--state); }
.card.is-none .card-clock { color: var(--text-3); text-shadow: none; }
.card.is-none .card-status { padding: 2px 9px; border: 1px solid var(--chip-edge); border-radius: 20px; background: var(--chip-bg); color: var(--text-2); }

/* the fuse: how far through the respawn wait */
.card-fuse { grid-area: fuse; position: relative; height: 2px; margin: 11px 0 10px; border-radius: 2px; background: var(--fuse-track); }
.card.is-none .card-fuse::after {
  content: '';
  position: absolute;
  left: 44%;
  width: 18%;
  height: 1px;
  background: var(--gold-light);
  box-shadow: 0 0 5px 1px color-mix(in srgb, var(--gold) 35%, transparent);
}
.card-fuse-fill { width: 0; max-width: 100%; height: 100%; border-radius: inherit; background: var(--state); box-shadow: 0 0 6px color-mix(in srgb, var(--state) 50%, transparent); }

.card-when { grid-area: when; min-height: 38px; font-size: 12px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.card-when b { color: var(--text); font-weight: 500; }
.card.is-none .card-when { display: flex; align-items: center; font-size: 14px; }
.card.is-none .card-when b { color: var(--gold); font-weight: 700; }

/* buttons: gold "ฆ่าแล้ว" with crossed swords, dark "ป้าย" with a flag */
.card-acts { grid-area: acts; display: flex; align-self: end; gap: 8px; margin-top: 10px; }
.card-acts .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--btn-dark-edge);
  border-radius: 8px;
  background: var(--btn-dark);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 2px 5px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: filter 120ms, transform 120ms;
}
.card-acts .card-kill {
  flex: 1;
  border-color: var(--gold-edge);
  background: var(--gold-fill);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 166, 0.36), inset 0 1px 2px rgba(255, 246, 198, 0.9), 0 0 8px color-mix(in srgb, var(--gold) 12%, transparent), 0 2px 5px rgba(0, 0, 0, 0.4);
  color: var(--on-gold);
  text-shadow: 0 1px 0 rgba(255, 234, 163, 0.4);
}
.card.is-window .card-kill, .card.is-up .card-kill {   /* time to press: the gold burns brighter */
  box-shadow: inset 0 0 0 1px rgba(255, 239, 166, 0.5), inset 0 1px 2px rgba(255, 246, 198, 0.9), 0 0 16px color-mix(in srgb, var(--gold) 45%, transparent), 0 2px 5px rgba(0, 0, 0, 0.4);
}
.card-acts .btn::before { content: ''; width: 19px; height: 19px; flex-shrink: 0; background: url('../assets/ui/flag.svg') center / contain no-repeat; }
.card-acts .card-kill::before { background-image: url('../assets/ui/swords.svg'); }
.card-acts .btn:hover { filter: brightness(1.1); }
.card-acts .btn:active { transform: translateY(1px); }

@media (pointer: coarse) {
  .card-menu, .grid.is-ordering .card-drag { width: 36px; height: 36px; }
  .card-acts .btn { min-height: 44px; }
}
/* phones (2 cards per row): medallion on its own row, the name gets the full width under it */
@media (max-width: 520px) {
  .card { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'medal' 'head' 'time' 'fuse' 'when' 'acts'; padding: 12px 10px 10px; border-radius: 12px; }
  .card-medal { width: 44px; height: 44px; margin: 0 0 10px; }
  .card-img { width: 36px; height: 36px; }
  .card-menu { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; margin: 0; }
  .grid.is-ordering .card-drag { position: absolute; top: 10px; right: 52px; width: 36px; height: 36px; margin: 0; }
  .card-title { padding: 0; }
  .card-name { font-size: 13px; min-height: 34px; }
  .card-map { margin-top: 2px; }
  .card-time { flex-direction: column; align-items: flex-start; gap: 5px; min-height: 52px; margin-top: 12px; }
  .card-clock { font-size: 24px; }
  .card.is-none .card-status { padding: 0 7px; }
  .card-fuse { margin: 9px 0 8px; }
  .card-when, .card.is-none .card-when { font-size: 12px; min-height: 39px; }
  .card-acts { gap: 6px; margin-top: 9px; }
  .card-acts .btn { min-height: 44px; padding: 7px 6px; gap: 4px; border-radius: 7px; font-size: 13px; }
  .card-acts .btn::before { width: 15px; height: 15px; }
}
@media (max-width: 360px) {
  .card-acts .btn::before { display: none; }
}
