/* ── Dashboard Header ── */
.dashboard-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.header-badges {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
  padding-top: 4px;
}

/* ── Player Grid ── */
.player-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
@media (max-width: 640px) {
  .player-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1100px) {
  .player-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Player Card ── */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
  position: relative;
}
.player-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--job-color, var(--color-primary));
  opacity: 0.8;
  transition: opacity var(--transition-base);
}
.player-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 8px 30px rgba(0,0,0,0.4);
}
.player-card:hover::before { opacity: 1; }
.player-card.loading .card-header { background: var(--bg-surface); }

/* Card header: character visual + name */
.card-header {
  position: relative;
  background: linear-gradient(135deg, #f6f4ff 0%, #eef3fb 100%);
  padding: var(--space-5) var(--space-5) var(--space-4) calc(var(--space-5) + 3px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-3);
  overflow: hidden;
}
.card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--job-color, var(--color-primary)) 12%, transparent) 0%,
    transparent 60%);
  pointer-events: none;
}
.card-header::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 80%, var(--bg-card) 100%);
  pointer-events: none;
}
.card-header-bg {
  position: absolute; inset: 0;
  opacity: 0.08;
  background-size: cover; background-position: center;
  filter: blur(2px);
}

.char-image-wrap {
  position: relative; z-index: 1; flex-shrink: 0;
  width: 260px; height: 280px;
  overflow: hidden;
}
/* Nexon look 이미지(300x300)는 캐릭터가 중앙(~y165)에 작게 들어있음.
   800px로 확대 후 캐릭터 중심(세로 54.3%)을 창 중앙에 정렬해 크롭 */
.char-image {
  position: absolute; left: 50%; top: 50%;
  width: 800px; height: 800px; max-width: none;
  transform: translate(-50%, -54.3%);
  filter: drop-shadow(0 8px 18px rgba(40, 30, 90, 0.28));
  image-rendering: pixelated;
  transition: transform var(--transition-base), filter var(--transition-base);
}
.player-card:hover .char-image {
  transform: translate(-50%, -54.3%) scale(1.04);
  filter: drop-shadow(0 12px 26px rgba(40, 30, 90, 0.36));
}
.char-image-placeholder {
  width: 260px; height: 280px;
  border-radius: var(--radius-md);
  background: var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 100px;
  color: var(--text-muted);
}

.card-header-info {
  position: relative; z-index: 1; width: 100%; min-width: 0;
}
.player-nickname {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-name {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-class-level {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; justify-content: center;
}
.char-class { font-size: var(--text-xs); }
.char-level {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-gold);
}
.char-server {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Card body: stats */
.card-body {
  padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
}

.stat-block { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-block-header {
  display: flex; align-items: center; justify-content: space-between;
}
.stat-block-label {
  font-size: var(--text-xs); color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.stat-block-value {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* Card footer: action buttons + synergy */
.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2);
}
.synergy-tags { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.synergy-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 10px; font-weight: var(--weight-semibold);
  background: var(--color-primary-glow);
  color: var(--color-primary-light);
  border: 1px solid rgba(124,92,252,0.2);
}
.card-actions { display: flex; gap: var(--space-2); }

/* ── Boss Overview ── */
.boss-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.boss-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.boss-card-name {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--text-primary); margin-bottom: var(--space-3);
  display: flex; align-items: center; justify-content: space-between;
}
.boss-player-list { display: flex; flex-direction: column; gap: var(--space-2); }
.boss-player-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs);
}
.boss-player-name { color: var(--text-secondary); }
.boss-done { color: var(--color-green); }
.boss-not-done { color: var(--text-muted); }

/* ── Union Ranking ── */
.union-ranking-list {
  display: flex; flex-direction: column; gap: var(--space-3);
}
.union-rank-item {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex; align-items: center; gap: var(--space-4);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.union-rank-item:hover { border-color: var(--border-hover); transform: translateX(4px); }
.rank-number {
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  width: 36px; text-align: center; flex-shrink: 0;
}
.rank-1 { color: var(--color-gold); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }
.rank-other { color: var(--text-muted); }

.rank-char-image {
  width: 48px; height: 56px;
  object-fit: contain; flex-shrink: 0;
  image-rendering: pixelated;
}
.rank-info { flex: 1; min-width: 0; }
.rank-nickname { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); }
.rank-charname { font-size: var(--text-xs); color: var(--text-secondary); }
.rank-right { text-align: right; flex-shrink: 0; }
.rank-union-level {
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  color: var(--color-primary-light);
}
.rank-union-label { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Card Power Row (전투력 / 이지카로스 / 무릉) ── */
.card-power-row {
  display: flex;
  gap: 0;
  background: rgba(124, 92, 252, 0.06);
  border: 1px solid rgba(124, 92, 252, 0.14);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-1);
}
.card-power-item {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  text-align: center;
  border-right: 1px solid rgba(124, 92, 252, 0.1);
}
.card-power-item:last-child { border-right: none; }
.card-power-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-power-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Boss Overview (visual) ── */
.bov-player-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-sm);
}
.bov-player-row:last-of-type { border-bottom: none; }
.bov-player-row:hover { background: rgba(124,92,252,0.04); }

.bov-left {
  min-width: 72px;
  flex-shrink: 0;
}
.bov-nickname {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.bov-score {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.bov-progress { flex: 1; min-width: 0; }

.bov-dots {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.bov-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  flex-shrink: 0;
  transition: all 0.2s;
}
.bov-dot.done { border-color: transparent; }
.bov-dot.current {
  width: 13px;
  height: 13px;
  border-width: 2px;
}
.bov-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  min-width: 6px;
}

.bov-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.bov-current-boss {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bov-next-boss {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Refresh animation ── */
.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error state on card ── */
.card-error {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-red);
  font-size: var(--text-sm);
}

/* ── 증감 배지 ── */
.delta-badge {
  font-size: 10px; font-weight: 700; margin-left: 4px;
  white-space: nowrap; vertical-align: middle;
}

/* ── 최근 변경 사항 섹션 ── */
#changes-content {
  display: flex; flex-direction: column; gap: var(--space-3);
}
.changes-stats { display: flex; flex-direction: column; gap: 4px; }
.changes-stat-row {
  font-size: var(--text-sm); color: var(--text-secondary);
  padding: 6px 10px; background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.changes-nick { font-weight: 600; color: var(--text-primary); }
.changes-items { display: flex; flex-direction: column; gap: var(--space-3); }
.changes-player-block {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-3);
}
.changes-item-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-2); margin-top: var(--space-2);
}
/* 이전 → 이후 아이템 변경 */
.changes-item-diff {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.ci-slot { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.ci-row { display: flex; align-items: center; gap: 8px; }
.ci-side {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.ci-side-empty {
  justify-content: center; color: var(--text-muted);
  font-size: var(--text-xs); font-style: italic;
}
.ci-icon {
  width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.ci-text { min-width: 0; }
.ci-name {
  font-size: var(--text-xs); font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ci-star { font-size: 10px; color: var(--color-gold); font-weight: 700; }
.ci-arrow { font-size: 16px; color: var(--color-primary); font-weight: 700; flex-shrink: 0; }
