:root {
  --panel: rgba(10, 12, 22, 0.84);
  --panel-strong: rgba(12, 15, 27, 0.94);
  --stroke: rgba(255, 255, 255, 0.11);
  --stroke-soft: rgba(255, 255, 255, 0.06);
  --text: #f4f5fb;
  --muted: #9aa2b8;
  --muted-2: #6f7890;
  --accent: #8f7bff;
  --danger: #ff6f82;
  --gold: #ffd166;
  --mono: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  overflow: hidden;
  pointer-events: none;
}

.ambient {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 55% 45% at 50% 32%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(ellipse 40% 32% at 8% 88%, rgba(72, 86, 255, 0.12), transparent 70%),
    radial-gradient(ellipse 36% 30% at 94% 82%, rgba(255, 78, 140, 0.09), transparent 70%);
  opacity: 0.9;
  transition: background 0.8s ease;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 0.7px, transparent 0.7px);
  background-size: 7px 7px;
  opacity: 0.09;
  mask-image: radial-gradient(ellipse at center, black 15%, transparent 70%);
}

.brand {
  position: absolute;
  top: 30px;
  left: 38px;
  display: flex;
  align-items: center;
  gap: 14px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 27px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 42%, #131625), #0d101c);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 30px color-mix(in srgb, var(--accent) 25%, transparent);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(7, 9, 16, 0.6);
  border: 1px solid var(--stroke-soft);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7b955;
  box-shadow: 0 0 8px currentColor;
}

.connection.is-online .connection-dot {
  background: #56e39f;
}

.connection.is-offline .connection-dot {
  background: var(--danger);
}

/* ------------------------------- boss panel ------------------------------ */

.boss-panel {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 1020px;
  padding: 20px 26px 24px;
  transform: translateX(-50%);
  border-radius: 26px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 45%),
    linear-gradient(180deg, rgba(18, 21, 36, 0.94), rgba(8, 10, 19, 0.91));
  border: 1px solid var(--stroke);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 60px color-mix(in srgb, var(--accent) 9%, transparent);
  backdrop-filter: blur(18px);
  animation: panelIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.boss-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 60%, transparent), transparent 32%, transparent 68%, rgba(255, 255, 255, 0.18));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.7;
  pointer-events: none;
}

.boss-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.phase-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke);
  color: #c9cfdf;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boss-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 7px 0 12px;
}

.boss-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 43px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}

.boss-title {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.boss-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.stun-badge,
.weak-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stun-badge {
  color: #c8efff;
  background: rgba(92, 190, 255, 0.14);
  border: 1px solid rgba(131, 216, 255, 0.35);
  box-shadow: 0 0 18px rgba(92, 190, 255, 0.18);
}

.weak-badge {
  color: color-mix(in srgb, var(--accent) 70%, white);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.boss-body {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 24px;
  align-items: center;
}

.boss-art {
  position: relative;
  width: 264px;
  height: 264px;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.012));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--stroke));
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.boss-art::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 150px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  filter: blur(13px);
  z-index: 0;
}

.boss-art img.asset-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.boss-art.has-image img.asset-image {
  opacity: 1;
}

.boss-art.has-image .sprite-placeholder {
  opacity: 0;
}

.sprite-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 126px;
  z-index: 1;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 35%, transparent));
  animation: floaty 4s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

.art-glow {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
  filter: blur(8px);
}

.hit-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.art-badges {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  gap: 5px;
}

.art-badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  background: rgba(5, 7, 14, 0.82);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: badgePulse 1.8s ease-in-out infinite;
}

.boss-detail {
  min-width: 0;
}

.hp-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hp-numbers {
  color: #d7dbea;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.hp-numbers strong {
  color: #fff;
  font-size: 23px;
  font-weight: 700;
}

.hp-track {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.boss-hp-track {
  height: 26px;
  margin-top: 7px;
}

.hp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, #281c48), var(--accent) 58%, color-mix(in srgb, var(--accent) 55%, white));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 48%, transparent);
  transition: width 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.5s ease;
}

.hp-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.31), transparent 46%, rgba(0, 0, 0, 0.12));
}

.hp-fill.low {
  background: linear-gradient(90deg, #8b1f32, var(--danger) 58%, #ffb1b9);
  box-shadow: 0 0 24px rgba(255, 76, 104, 0.55);
  animation: lowPulse 1.1s ease-in-out infinite;
}

.phase-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(4, 6, 12, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.13);
  z-index: 2;
}

.phase-marker[data-at="0.5"] { left: 50%; }
.phase-marker[data-at="0.2"] { left: 20%; }

.phase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.phase-label {
  color: color-mix(in srgb, var(--accent) 62%, white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-percent {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.boss-meta {
  min-height: 22px;
  margin-top: 7px;
}

.weakness-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #aeb6c9;
  font-size: 11px;
}

.weakness-text::before {
  content: "◆";
  color: var(--accent);
  font-size: 8px;
}

.weakness-text:empty {
  display: none;
}

.buff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  margin-top: 8px;
}

.buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, 0.035));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  color: #d6daea;
  font-size: 10px;
  animation: chipIn 0.3s ease both;
}

.buff-chip .buff-time {
  color: var(--muted-2);
  font-family: var(--mono);
}

.boss-mvp {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke-soft);
  font-size: 11px;
}

.mvp-label {
  padding: 3px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd166, #f39c3d);
  color: #2b1a05;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.mvp-name {
  color: #ebedf5;
  font-weight: 700;
}

.mvp-damage {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

/* --------------------------------- idle ---------------------------------- */

.idle-panel {
  position: absolute;
  top: 220px;
  left: 50%;
  width: 720px;
  padding: 40px 48px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 30px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(22, 24, 40, 0.9), rgba(8, 10, 18, 0.88));
  border: 1px solid var(--stroke);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  animation: panelIn 0.5s ease both;
}

.idle-orb {
  flex: 0 0 108px;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 44px;
  color: var(--accent);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 65%),
    rgba(255, 255, 255, 0.035);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 0 46px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: floaty 4.5s ease-in-out infinite;
}

.idle-copy .eyebrow {
  margin-bottom: 8px;
}

.idle-copy h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 38px;
  letter-spacing: 0.02em;
}

.idle-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.idle-copy .idle-hint {
  color: var(--muted-2);
  font-size: 11px;
}

.idle-hint code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #c6cbe0;
  font-family: var(--mono);
}

/* -------------------------------- panels --------------------------------- */

.side-panel {
  position: absolute;
  width: 340px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 18, 31, 0.9), rgba(8, 10, 18, 0.86));
  border: 1px solid var(--stroke);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.monsters-panel {
  top: 470px;
  left: 38px;
  animation: slideInLeft 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.leaderboard-panel {
  top: 470px;
  right: 38px;
  animation: slideInRight 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: #bfc5d8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.count-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke-soft);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.monsters-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.monster-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 9px 12px 9px 9px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--stroke-soft);
  overflow: hidden;
  animation: monsterIn 0.38s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.monster-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--monster-accent, var(--accent));
  opacity: 0.75;
}

.monster-card.is-dead {
  opacity: 0;
  transform: translateX(-14px) scale(0.96);
}

.monster-art {
  position: relative;
  width: 74px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--monster-accent, var(--accent)) 22%, transparent), transparent 66%);
}

.monster-emoji {
  font-size: 38px;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
  transition: opacity 0.25s ease;
}

.monster-art img.monster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.monster-card.has-image .monster-art img.monster-image {
  opacity: 1;
}

.monster-card.has-image .monster-emoji {
  opacity: 0;
}

.monster-hit-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.monster-copy {
  min-width: 0;
}

.monster-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.monster-name {
  overflow: hidden;
  color: #e5e8f2;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monster-hp-text {
  flex: none;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.monster-hp-track {
  height: 7px;
  margin-top: 7px;
}

.monster-hp-track .hp-fill {
  box-shadow: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--monster-accent, var(--accent)) 70%, #161927), var(--monster-accent, var(--accent)));
}

.monsters-empty {
  padding: 20px 8px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.leaderboard {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 43px;
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid transparent;
  transition: background 0.25s ease;
}

.leaderboard-row:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.11), rgba(255, 255, 255, 0.025));
  border-color: rgba(255, 209, 102, 0.16);
}

.rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.leaderboard-row:nth-child(1) .rank {
  background: linear-gradient(135deg, #ffd166, #f39c3d);
  color: #2b1a05;
}

.player-copy {
  min-width: 0;
}

.player-name {
  overflow: hidden;
  color: #e1e4ee;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-role {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
}

.player-damage {
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.player-damage span {
  margin-left: 2px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.leaderboard-empty {
  padding: 24px 6px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke-soft);
}

.session-stats > div {
  padding: 7px 5px;
  text-align: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.026);
}

.session-stats strong {
  display: block;
  color: #e3e6f0;
  font-family: var(--mono);
  font-size: 17px;
}

.session-stats span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------- feed ---------------------------------- */

.feed-panel {
  position: absolute;
  bottom: 30px;
  left: 50%;
  width: 880px;
  padding: 14px 18px 16px;
  transform: translateX(-50%);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(11, 13, 24, 0.82), rgba(7, 8, 15, 0.9));
  border: 1px solid var(--stroke-soft);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.feed-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5570;
  box-shadow: 0 0 9px #ff5570;
  animation: livePulse 1.5s ease-in-out infinite;
}

.feed-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 7px;
  color: #b6bdd0;
  font-size: 11px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.022);
  animation: feedIn 0.32s ease both;
}

.feed-item::before {
  content: "";
  flex: 0 0 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--muted-2);
}

.feed-item[data-type="drop"] {
  color: #ffe9ac;
  background: rgba(255, 209, 102, 0.07);
}

.feed-item[data-type="drop"]::before { background: var(--gold); }
.feed-item[data-type="boss"] { color: #ffc3cc; }
.feed-item[data-type="boss"]::before { background: var(--danger); }
.feed-item[data-type="phase"] { color: #d4c8ff; }
.feed-item[data-type="phase"]::before { background: #a98cff; }
.feed-item[data-type="buff"] { color: #b7e8ff; }
.feed-item[data-type="buff"]::before { background: #6fd1ff; }
.feed-item[data-type="debuff"],
.feed-item[data-type="steal"] { color: #ffbdba; }
.feed-item[data-type="debuff"]::before,
.feed-item[data-type="steal"]::before { background: #ff7b70; }
.feed-item[data-type="stun"] { color: #bde9ff; }
.feed-item[data-type="stun"]::before { background: #84d8ff; }
.feed-item[data-type="cleanse"] { color: #ffeeb9; }
.feed-item[data-type="cleanse"]::before { background: #ffe08a; }
.feed-item[data-type="monster"],
.feed-item[data-type="kill"] { color: #c8cfde; }
.feed-item[data-type="skill"] { color: #d7d1ff; }
.feed-item[data-type="skill"]::before { background: #9b8cff; }

/* -------------------------------- toasts --------------------------------- */

.toast-layer {
  position: absolute;
  left: 50%;
  bottom: 335px;
  width: 560px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 330px;
  max-width: 560px;
  padding: 12px 17px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(24, 27, 46, 0.97), rgba(9, 11, 20, 0.97));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--stroke));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 30px color-mix(in srgb, var(--accent) 12%, transparent);
  animation: toastIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.toast.is-leaving {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 20px;
  background: color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.toast-copy {
  min-width: 0;
}

.toast-title {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.toast-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.toast-text strong {
  color: color-mix(in srgb, var(--accent) 65%, white);
}

/* ------------------------------- hit / fx -------------------------------- */

.float-hit {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 6;
  color: #fff;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent);
  animation: hitFloat 1.05s cubic-bezier(0.15, 0.75, 0.3, 1) forwards;
  pointer-events: none;
  white-space: nowrap;
}

.float-hit.is-critical {
  color: #ffe27a;
  font-size: 30px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 22px rgba(255, 203, 84, 0.65);
}

.float-hit.is-weak {
  color: #b8ff9c;
}

.float-hit.is-skill {
  color: #d2c2ff;
}

.float-hit.is-dot {
  color: #a7e46c;
  font-size: 16px;
  opacity: 0.86;
}

.boss-art.hurt {
  animation: bossHurt 0.28s ease;
}

.boss-art.attacking {
  animation: bossAttack 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.monster-card.hurt {
  animation: monsterHurt 0.26s ease;
}

.boss-panel.phase-flash {
  animation: phaseFlash 0.7s ease;
}

.boss-panel.low-hp .boss-name {
  color: #ffd3d8;
}

.boss-panel.buffed .boss-art {
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 38px color-mix(in srgb, var(--accent) 35%, transparent);
}

.is-hidden {
  display: none !important;
}

/* ------------------------------ animations ------------------------------- */

@keyframes panelIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.985); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes lowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes badgePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes monsterIn {
  from { opacity: 0; transform: translateX(-16px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes feedIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

@keyframes hitFloat {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(0.94); }
}

@keyframes bossHurt {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  25% { transform: translateX(-6px); filter: brightness(1.4); }
  55% { transform: translateX(5px); filter: brightness(1.15); }
  78% { transform: translateX(-2px); }
}

@keyframes monsterHurt {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px); filter: brightness(1.35); }
  70% { transform: translateX(3px); }
}

@keyframes bossAttack {
  0%, 100% { transform: translateX(0) scale(1); filter: brightness(1); }
  38% { transform: translateX(7px) scale(1.035); filter: brightness(1.25) saturate(1.2); }
  62% { transform: translateX(-3px) scale(1.01); }
}

@keyframes phaseFlash {
  0%, 100% { border-color: var(--stroke); }
  35% { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 70px color-mix(in srgb, var(--accent) 28%, transparent); }
}


/* --------------------------- friction sprites ---------------------------- */
/* Animations are authored as the Friction state set (idle / spawn / hit /
   attack / death / low_hp) and played on top of the static or SVG sprite. */

.boss-art img.asset-image,
.boss-art .sprite-layer,
.monster-art img.monster-image,
.monster-art .sprite-layer {
  transform-origin: 50% 88%;
  will-change: transform, filter;
  animation: spriteIdle 3.6s ease-in-out infinite;
}

.boss-art .sprite-layer,
.monster-art .sprite-layer {
  position: absolute;
  left: 5%;
  top: 5%;
  width: 90%;
  height: 90%;
  object-fit: contain;
  z-index: 3;
}

.boss-art.has-sprite-file img.asset-image,
.monster-art.has-sprite-file img.monster-image {
  opacity: 0;
}

.boss-art.has-friction .sprite-placeholder,
.monster-art.has-friction .monster-emoji {
  opacity: 0;
}

.boss-art.fx-spawn img,
.monster-art.fx-spawn img {
  animation: spriteSpawn 0.62s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.boss-art.fx-hit img,
.monster-art.fx-hit img {
  animation: spriteHit 0.32s ease;
}

.boss-art.fx-attack img,
.monster-art.fx-attack img {
  animation: spriteAttack 0.52s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.boss-art.fx-death img,
.monster-art.fx-death img {
  animation: spriteDeath 0.9s cubic-bezier(0.4, 0, 0.8, 0.4) forwards;
}

.boss-art.fx-lowhp img,
.monster-art.fx-lowhp img {
  animation: spriteIdle 3.6s ease-in-out infinite, spriteLowHp 1.5s ease-in-out infinite;
}

.boss-art.fx-buffed {
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 42px color-mix(in srgb, var(--accent) 45%, transparent);
}

@keyframes spriteIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.015); }
}

@keyframes spriteSpawn {
  0% { opacity: 0; transform: translateY(18px) scale(0.25) rotate(-9deg); }
  62% { opacity: 1; transform: translateY(-6px) scale(1.07) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes spriteHit {
  0%, 100% { filter: brightness(1) saturate(1); }
  14% { filter: brightness(2.6) saturate(0.15) drop-shadow(0 0 16px rgba(255, 255, 255, 0.9)); transform: translateX(-3px) scale(0.985); }
  42% { filter: brightness(1.35) saturate(1.1); transform: translateX(3px); }
  70% { filter: brightness(1.1); transform: translateX(-1px); }
}

@keyframes spriteAttack {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0); }
  34% { transform: translate(16px, 5px) scale(1.06) rotate(2.5deg); }
  66% { transform: translate(-5px, 0) scale(1.01) rotate(-1deg); }
}

@keyframes spriteDeath {
  0% { opacity: 1; transform: translateY(0) rotate(0) scale(1); filter: grayscale(0); }
  55% { opacity: 0.75; transform: translateY(10px) rotate(7deg) scale(0.9); filter: grayscale(0.6) brightness(0.8); }
  100% { opacity: 0; transform: translateY(34px) rotate(15deg) scale(0.6); filter: grayscale(1) brightness(0.55); }
}

@keyframes spriteLowHp {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.16) saturate(1.35) drop-shadow(0 0 22px rgba(255, 62, 92, 0.55)); }
}

.monster-art.fx-lowhp img {
  animation: spriteIdle 3.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
