/* Live Stats — Dashboard Styles */

:root {
  --bg-deep: #06060b;
  --bg-panel: rgba(14, 14, 24, 0.72);
  --bg-panel-hover: rgba(20, 20, 34, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f8;
  --text-muted: #8b90a8;
  --purple: #a855f7;
  --blue: #3b82f6;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --win: #34d399;
  --lose: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Orbitron', var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background effects */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.bg-glow--purple {
  width: 480px;
  height: 480px;
  background: var(--purple);
  top: -120px;
  left: -80px;
}

.bg-glow--blue {
  width: 400px;
  height: 400px;
  background: var(--blue);
  top: 40%;
  right: -100px;
}

.bg-glow--pink {
  width: 360px;
  height: 360px;
  background: var(--pink);
  bottom: -80px;
  left: 30%;
}

/* Layout */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: rgba(8, 8, 14, 0.6);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.4);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  margin: 0;
}

.brand__tik {
  color: #fff;
}

.brand__log {
  background: linear-gradient(90deg, #c084fc, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand__ja {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.brand__tag {
  margin: 0.12rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav__item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav__item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav__item--active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.sidebar__profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.sidebar__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar__handle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-pill {
  width: 100%;
  text-align: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

/* Main */
.main {
  padding: 1.5rem 2rem 2rem;
  max-width: 1200px;
  width: 100%;
}

/* Hero + Profile */
.hero {
  display: grid;
  grid-template-columns: 1fr min(340px, 100%);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}

.hero__welcome {
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.08);
}

.hero__eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.hero__title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.65rem;
  background: linear-gradient(135deg, #fff 20%, #c084fc 60%, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero__subtitle strong {
  color: var(--text);
  font-weight: 600;
}

.hero__dot {
  margin: 0 0.4rem;
  opacity: 0.4;
}

/* AI Coach Card */
.ai-coach-card {
  position: relative;
  margin: 1rem 0 1.1rem;
  padding: 1rem 1.1rem 0.85rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.12),
    0 0 40px rgba(168, 85, 247, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ai-coach-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
}

.ai-coach-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ai-coach-card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
}

.ai-coach-card__meta {
  flex: 1;
  min-width: 0;
}

.ai-coach-card__label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  margin-bottom: 0.15rem;
}

.ai-coach-card__roles {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.ai-coach-card__reload {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cyan);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ai-coach-card__reload:hover {
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}

.ai-coach-card__reload--spin {
  animation: ai-coach-spin 0.5s ease;
}

@keyframes ai-coach-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ai-coach-card__body {
  display: grid;
  gap: 0.55rem;
}

.ai-coach-card__quote {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  padding: 0.15rem 0 0.15rem 0.5rem;
  border-left: 2px solid rgba(168, 85, 247, 0.45);
}

.ai-coach-card__updated {
  margin-top: 0.75rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
}

.ai-coach-card__schedule {
  color: var(--cyan);
}

.profile-card {
  position: relative;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow), 0 0 48px rgba(59, 130, 246, 0.12);
  overflow: hidden;
}

.profile-card__glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35), transparent 70%);
  pointer-events: none;
}

.profile-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.profile-card__avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 24px rgba(236, 72, 153, 0.4);
  flex-shrink: 0;
}

.profile-card__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.profile-card__name {
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-card__id {
  font-size: 0.8rem;
  color: var(--cyan);
}

.profile-card__affiliation {
  margin-bottom: 1rem;
}

.profile-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.profile-card__stat {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.profile-card__stat dt {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.profile-card__stat dd {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.affiliation-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.affiliation-badge--large {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
}

.sidebar__profile-text {
  flex: 1;
  min-width: 0;
}

.sidebar__since {
  width: 100%;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section__badge {
  font-size: 0.65rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.career-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem;
}

.career-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.career-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.career-card--purple::before { background: linear-gradient(90deg, var(--purple), transparent); }
.career-card--blue::before { background: linear-gradient(90deg, var(--blue), transparent); }
.career-card--pink::before { background: linear-gradient(90deg, var(--pink), transparent); }

.career-card__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.career-card__value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.career-card--purple .career-card__value { color: #c084fc; }
.career-card--blue .career-card__value { color: #60a5fa; }
.career-card--pink .career-card__value { color: #f472b6; }

.header {
  display: none;
}

.header__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 0.25rem;
}

.header__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--purple) 70%, var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.demo-badge {
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.08);
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.5);
}

/* Sections */
.section {
  margin-bottom: 1.75rem;
}

.section__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}

.stat-card--purple { border-top: 2px solid var(--purple); }
.stat-card--blue { border-top: 2px solid var(--blue); }
.stat-card--pink { border-top: 2px solid var(--pink); }

.stat-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.stat-card--purple .stat-card__value { color: #c084fc; }
.stat-card--blue .stat-card__value { color: #60a5fa; }
.stat-card--pink .stat-card__value { color: #f472b6; }

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.panel--wide {
  margin-bottom: 1.25rem;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.panel__title {
  font-size: 1rem;
  font-weight: 600;
}

.panel__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* PK list */
.pk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pk-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.pk-item:hover {
  border-color: var(--border);
}

.pk-item__main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pk-item__vs {
  font-size: 0.9rem;
}

.pk-item__score {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--cyan);
}

.pk-item__time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Gift list */
.gift-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gift-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.gift-item__rank {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--purple);
  min-width: 2rem;
}

.gift-item__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.gift-item__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gift-item__diamonds {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pink);
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.badge-win {
  color: var(--win);
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge-lose {
  color: var(--lose);
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.text-win { color: var(--win); }
.text-lose { color: var(--lose); }
.text-muted { color: var(--text-muted); font-size: 0.8rem; }

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 500;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .profile-card {
    order: -1;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }

  /* SaaS 成長ダッシュボード: 縦型サイドバーを維持 */
  .sidebar.sidebar--saas {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: 'brand' 'nav';
    gap: 0;
    overflow: hidden;
  }

  .sidebar.sidebar--saas .streamer-switcher {
    width: 100%;
    order: unset;
  }

  .sidebar.sidebar--saas .nav,
  .sidebar.sidebar--saas .sidebar-nav {
    order: unset;
    width: auto;
  }

  .sidebar.sidebar--saas .sidebar__footer {
    order: unset;
    width: auto;
  }

  .brand {
    order: 1;
  }

  .nav {
    order: 3;
  }

  .streamer-switcher {
    width: 100%;
    order: 2;
  }

  .sidebar__profile {
    order: 4;
  }

  .sidebar__footer {
    order: 5;
    width: 100%;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 1.25rem;
  }

  .pk-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 480px) {
  .profile-card__stats {
    grid-template-columns: 1fr;
  }

  .career-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .table {
    font-size: 0.78rem;
  }
}

/* ── Earned Badges ─────────────────────────────────────── */

.section--badges {
  margin-bottom: 2rem;
}

.badge-scroll-wrap {
  position: relative;
  margin: 0 -0.25rem;
  padding: 0.25rem;
}

.badge-scroll-wrap::before,
.badge-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
}

.badge-scroll-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-deep), transparent);
}

.badge-scroll-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-deep), transparent);
}

.badge-scroll {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0.5rem 0.85rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.45) transparent;
}

.badge-scroll::-webkit-scrollbar {
  height: 6px;
}

.badge-scroll::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.45);
  border-radius: 999px;
}

.badge-card {
  position: relative;
  flex: 0 0 min(240px, 78vw);
  scroll-snap-align: start;
  text-align: left;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.badge-card:hover {
  transform: translateY(-2px);
}

.badge-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.badge-card__glow {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
}

.badge-card__rarity {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.badge-card__description {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge-card__date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.badge-empty {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.badge-empty code {
  font-size: 0.78rem;
  color: var(--cyan);
}

.badge-collection-group {
  margin-top: 1.25rem;
}

.badge-collection-group:first-of-type {
  margin-top: 0.5rem;
}

.badge-collection-group__title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  padding-left: 0.15rem;
}

.badge-card--locked {
  opacity: 0.92;
  min-height: 220px;
}

.badge-card--locked:hover {
  opacity: 1;
}

.badge-card__lock {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.45));
}

.badge-card__progress-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.badge-card__progress-text--muted {
  color: var(--text-muted);
  font-weight: 500;
}

.badge-card__progress-rate {
  font-size: 0.68rem;
  color: var(--cyan);
  margin-bottom: 0.45rem;
}

.badge-card__gate-note {
  margin-top: 0.4rem;
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.badge-card__progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.badge-card__progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.85), rgba(59, 130, 246, 0.85));
}

.badge-card__progress-fill--common {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.9), rgba(203, 213, 225, 0.85));
}

.badge-card__progress-fill--rare {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), rgba(147, 197, 253, 0.85));
}

.badge-card__progress-fill--epic {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.9), rgba(216, 180, 254, 0.85));
}

.badge-card__progress-fill--legendary {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(253, 230, 138, 0.9));
}

.badge-card__progress-fill--mythic {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.9), rgba(59, 130, 246, 0.9), rgba(168, 85, 247, 0.9));
}

/* Rarity: Common */
.badge-card--common {
  border-color: rgba(148, 163, 184, 0.35);
}

.badge-card--common .badge-card__glow {
  background: radial-gradient(circle at top right, rgba(148, 163, 184, 0.18), transparent 65%);
}

.badge-card--common .badge-card__rarity {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}

.badge-card--common .badge-card__title {
  color: #e2e8f0;
}

.badge-card--common:hover {
  box-shadow: 0 8px 28px rgba(148, 163, 184, 0.12);
}

/* Rarity: Rare */
.badge-card--rare {
  border-color: rgba(59, 130, 246, 0.45);
}

.badge-card--rare .badge-card__glow {
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.25), transparent 65%);
}

.badge-card--rare .badge-card__rarity {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
}

.badge-card--rare .badge-card__title {
  color: #bfdbfe;
}

.badge-card--rare:hover {
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.2);
}

/* Rarity: Epic */
.badge-card--epic {
  border-color: rgba(168, 85, 247, 0.5);
}

.badge-card--epic .badge-card__glow {
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.28), transparent 65%);
}

.badge-card--epic .badge-card__rarity {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.38);
}

.badge-card--epic .badge-card__title {
  color: #e9d5ff;
}

.badge-card--epic:hover {
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.22);
}

/* Rarity: Legendary */
.badge-card--legendary {
  border-color: rgba(251, 191, 36, 0.55);
}

.badge-card--legendary .badge-card__glow {
  background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.28), transparent 65%);
}

.badge-card--legendary .badge-card__rarity {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
}

.badge-card--legendary .badge-card__title {
  color: #fef3c7;
}

.badge-card--legendary:hover {
  box-shadow: 0 8px 28px rgba(251, 191, 36, 0.22);
}

/* Rarity: Mythic */
.badge-card--mythic {
  border-color: rgba(236, 72, 153, 0.45);
  animation: badge-mythic-border 4s linear infinite;
}

.badge-card--mythic .badge-card__glow {
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.22),
    rgba(59, 130, 246, 0.22),
    rgba(168, 85, 247, 0.22)
  );
}

.badge-card--mythic .badge-card__rarity {
  color: #fff;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(59, 130, 246, 0.35), rgba(168, 85, 247, 0.35));
  border-color: rgba(255, 255, 255, 0.25);
}

.badge-card--mythic .badge-card__title {
  background: linear-gradient(135deg, #fda4af, #93c5fd, #d8b4fe, #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-card--mythic:hover {
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.28), 0 0 24px rgba(236, 72, 153, 0.18);
}

@keyframes badge-mythic-border {
  0% { border-color: rgba(236, 72, 153, 0.55); }
  33% { border-color: rgba(59, 130, 246, 0.55); }
  66% { border-color: rgba(168, 85, 247, 0.55); }
  100% { border-color: rgba(251, 191, 36, 0.55); }
}

/* Badge modal */
.badge-modal[hidden] {
  display: none !important;
}

.badge-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.badge-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 11, 0.82);
  backdrop-filter: blur(8px);
}

.badge-modal__dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 48px rgba(168, 85, 247, 0.15);
  animation: badge-modal-in 0.25s ease;
}

@keyframes badge-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.badge-modal__dialog--rare { border-color: rgba(59, 130, 246, 0.45); }
.badge-modal__dialog--epic { border-color: rgba(168, 85, 247, 0.5); }
.badge-modal__dialog--legendary { border-color: rgba(251, 191, 36, 0.55); }
.badge-modal__dialog--mythic {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: var(--shadow), 0 0 56px rgba(168, 85, 247, 0.25);
}

.badge-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.badge-modal__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.badge-modal__icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.badge-modal__rarity {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  color: var(--cyan);
}

.badge-modal__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.65rem;
}

.badge-modal__description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.badge-modal__meta {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.badge-modal__meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
}

.badge-modal__meta dt {
  color: var(--text-muted);
}

.badge-modal__meta dd {
  font-weight: 500;
  text-align: right;
}

body.badge-modal-open {
  overflow: hidden;
}

/* ── Badge Celebration ─────────────────────────────────── */

.badge-celebration[hidden] {
  display: none !important;
}

.badge-celebration {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: hidden;
}

.badge-celebration__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, 0.88);
  backdrop-filter: blur(10px);
  animation: badge-celebration-backdrop-in 0.35s ease;
}

@keyframes badge-celebration-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.badge-celebration__confetti,
.badge-celebration__sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.badge-celebration__confetti {
  z-index: 1;
}

.badge-celebration__sparkles {
  z-index: 2;
}

.badge-celebration__confetti span {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: badge-celebration-confetti-fall var(--duration, 3s) ease-in var(--delay, 0s) forwards;
  transform: rotate(var(--rotate, 0deg));
}

@keyframes badge-celebration-confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotate, 0deg));
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(calc(var(--rotate, 0deg) + 540deg));
  }
}

.badge-celebration__sparkle {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 24px rgba(168, 85, 247, 0.55);
  animation: badge-celebration-sparkle 1.8s ease-in-out var(--delay, 0s) infinite;
}

@keyframes badge-celebration-sparkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.2); }
}

.badge-celebration__dialog {
  position: relative;
  z-index: 3;
  width: min(440px, 100%);
  padding: 1.75rem 1.5rem 1.4rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, rgba(18, 18, 28, 0.98), rgba(10, 10, 18, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow:
    var(--shadow),
    0 0 60px rgba(168, 85, 247, 0.22),
    0 0 120px rgba(59, 130, 246, 0.12);
  text-align: center;
  animation: badge-celebration-dialog-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes badge-celebration-dialog-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.badge-celebration__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.18), transparent 62%);
  pointer-events: none;
  animation: badge-celebration-glow-pulse 2.4s ease-in-out infinite;
}

@keyframes badge-celebration-glow-pulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.badge-celebration__eyebrow {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fde68a;
  margin-bottom: 0.55rem;
}

.badge-celebration__rarity {
  position: relative;
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-celebration__title {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.badge-celebration__description {
  position: relative;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}

.badge-celebration__actions {
  position: relative;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge-celebration__btn {
  min-width: 132px;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.badge-celebration__btn--primary {
  border: 1px solid rgba(168, 85, 247, 0.55);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(59, 130, 246, 0.75));
  color: #fff;
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.28);
}

.badge-celebration__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.38);
}

.badge-celebration__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.badge-celebration__btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

/* Rarity variants */
.badge-celebration__dialog--common {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow), 0 0 48px rgba(148, 163, 184, 0.15);
}

.badge-celebration__dialog--common .badge-celebration__title { color: #e2e8f0; }
.badge-celebration__dialog--common .badge-celebration__rarity {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}

.badge-celebration__dialog--rare {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: var(--shadow), 0 0 56px rgba(59, 130, 246, 0.22);
}

.badge-celebration__dialog--rare .badge-celebration__title { color: #bfdbfe; }
.badge-celebration__dialog--rare .badge-celebration__rarity {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
}

.badge-celebration__dialog--rare .badge-celebration__glow {
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.22), transparent 62%);
}

.badge-celebration__dialog--epic {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: var(--shadow), 0 0 64px rgba(168, 85, 247, 0.28), 0 0 100px rgba(236, 72, 153, 0.12);
}

.badge-celebration__dialog--epic .badge-celebration__title { color: #e9d5ff; }
.badge-celebration__dialog--epic .badge-celebration__rarity {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.38);
}

.badge-celebration__dialog--epic .badge-celebration__glow {
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.28), rgba(236, 72, 153, 0.08), transparent 68%);
}

.badge-celebration__dialog--legendary {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow:
    var(--shadow),
    0 0 72px rgba(251, 191, 36, 0.28),
    0 0 120px rgba(251, 191, 36, 0.12);
}

.badge-celebration__dialog--legendary .badge-celebration__title { color: #fef3c7; }
.badge-celebration__dialog--legendary .badge-celebration__rarity {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
}

.badge-celebration__dialog--legendary .badge-celebration__glow {
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.08), transparent 68%);
}

.badge-celebration__dialog--legendary .badge-celebration__eyebrow {
  color: #fde68a;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}

.badge-celebration__dialog--mythic {
  border-color: rgba(236, 72, 153, 0.55);
  animation:
    badge-celebration-dialog-in 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    badge-celebration-mythic-border 4s linear infinite;
  box-shadow:
    var(--shadow),
    0 0 80px rgba(236, 72, 153, 0.28),
    0 0 120px rgba(59, 130, 246, 0.2),
    0 0 160px rgba(168, 85, 247, 0.18);
}

.badge-celebration__dialog--mythic .badge-celebration__title {
  background: linear-gradient(135deg, #fda4af, #93c5fd, #d8b4fe, #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-celebration__dialog--mythic .badge-celebration__rarity {
  color: #fff;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(59, 130, 246, 0.35), rgba(168, 85, 247, 0.35));
  border-color: rgba(255, 255, 255, 0.25);
}

.badge-celebration__dialog--mythic .badge-celebration__glow {
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.25),
    rgba(59, 130, 246, 0.22),
    rgba(168, 85, 247, 0.25)
  );
  animation: badge-celebration-glow-pulse 1.6s ease-in-out infinite;
}

@keyframes badge-celebration-mythic-border {
  0% { border-color: rgba(236, 72, 153, 0.65); }
  33% { border-color: rgba(59, 130, 246, 0.65); }
  66% { border-color: rgba(168, 85, 247, 0.65); }
  100% { border-color: rgba(251, 191, 36, 0.65); }
}

body.badge-celebration-open {
  overflow: hidden;
}

.badge-collection-section--highlight {
  animation: badge-collection-highlight 1.6s ease;
}

@keyframes badge-collection-highlight {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.45), 0 0 40px rgba(168, 85, 247, 0.18); }
}

/* ── Notification Center ───────────────────────────────── */

.notification-center {
  position: fixed;
  top: 1.1rem;
  right: 1.25rem;
  z-index: 950;
}

.notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(12, 12, 20, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 24px rgba(168, 85, 247, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.notification-bell:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 32px rgba(168, 85, 247, 0.22);
}

.notification-bell:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.notification-bell__icon {
  font-size: 1.15rem;
  line-height: 1;
}

.notification-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.notification-modal[hidden] {
  display: none !important;
}

.notification-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  justify-items: end;
  align-items: start;
  padding: 4.5rem 1.25rem 1.25rem;
  pointer-events: none;
}

.notification-modal:not([hidden]) {
  display: grid;
}

.notification-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  animation: notification-backdrop-in 0.25s ease;
}

@keyframes notification-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.notification-modal__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(16, 16, 26, 0.98), rgba(8, 8, 14, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow:
    var(--shadow),
    0 0 48px rgba(168, 85, 247, 0.18),
    0 0 80px rgba(59, 130, 246, 0.1);
  pointer-events: auto;
  animation: notification-panel-in 0.28s ease;
  overflow: hidden;
}

@keyframes notification-panel-in {
  from {
    opacity: 0;
    transform: translateY(-8px) translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

.notification-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notification-modal__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.notification-modal__count {
  font-size: 0.72rem;
  color: var(--cyan);
}

.notification-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.notification-modal__mark-all {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.notification-modal__mark-all:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
}

.notification-modal__mark-all:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notification-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.notification-modal__close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.notification-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-item--unread {
  border-color: rgba(168, 85, 247, 0.42);
  background: rgba(168, 85, 247, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(168, 85, 247, 0.12),
    0 0 18px rgba(168, 85, 247, 0.14);
  animation: notification-unread-glow 2.4s ease-in-out infinite;
}

@keyframes notification-unread-glow {
  0%, 100% {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow:
      inset 0 0 0 1px rgba(168, 85, 247, 0.1),
      0 0 14px rgba(168, 85, 247, 0.12);
  }
  50% {
    border-color: rgba(236, 72, 153, 0.55);
    box-shadow:
      inset 0 0 0 1px rgba(168, 85, 247, 0.2),
      0 0 28px rgba(168, 85, 247, 0.28),
      0 0 40px rgba(59, 130, 246, 0.12);
  }
}

.notification-item--unread .notification-item__icon {
  animation: notification-icon-pulse 2.4s ease-in-out infinite;
}

@keyframes notification-icon-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

.notification-item--unread .notification-item__dot {
  animation: notification-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes notification-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.notification-item__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.06);
}

.notification-item--purple .notification-item__icon {
  background: rgba(168, 85, 247, 0.16);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.notification-item--pink .notification-item__icon {
  background: rgba(236, 72, 153, 0.16);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.18);
}

.notification-item--blue .notification-item__icon {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.18);
}

.notification-item--cyan .notification-item__icon {
  background: rgba(34, 211, 238, 0.14);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.16);
}

.notification-item--violet .notification-item__icon {
  background: rgba(168, 85, 247, 0.18);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.16), 0 0 20px rgba(168, 85, 247, 0.18);
}

.notification-item--read {
  opacity: 0.72;
}

.notification-item__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.notification-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.notification-item__time {
  margin-left: auto;
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.notification-item__type {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.notification-item__status {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.notification-item__status--unread {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.notification-item__status--read {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.notification-item__title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.notification-item__message {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.notification-item__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.75);
}

.notification-empty {
  padding: 1.5rem 1rem 1.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

body.notification-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .notification-center {
    top: 0.75rem;
    right: 0.75rem;
  }

  .notification-modal {
    padding: 3.75rem 0.75rem 0.75rem;
    justify-items: stretch;
  }

  .notification-modal__panel {
    width: 100%;
    max-height: min(75vh, 640px);
  }

  .badge-card {
    flex-basis: min(220px, 85vw);
  }
}

/* ── Login (Phase 1) ─────────────────────────────────────── */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
}

.login-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.login-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.login-card__lead {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.login-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.login-form__label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-form__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.login-form__prefix {
  color: var(--text-muted);
}

.login-form__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 0.75rem 0;
  outline: none;
}

.login-form__submit,
.login-member-card {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.login-form__submit {
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-weight: 600;
}

.login-form__submit:hover,
.login-member-card:hover {
  transform: translateY(-1px);
}

.login-divider {
  display: grid;
  place-items: center;
  margin: 1.5rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  width: 100%;
  height: 1px;
  background: var(--border);
}

.login-divider {
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
}

.login-members__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.login-members__list {
  display: grid;
  gap: 0.65rem;
}

.login-member-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
}

.login-member-card__avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.18);
  color: var(--purple);
  font-weight: 700;
}

.login-member-card__body {
  display: grid;
  gap: 0.15rem;
}

.login-member-card__name {
  font-weight: 600;
}

.login-member-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.login-members__empty,
.login-error {
  color: #fca5a5;
  font-size: 0.85rem;
}

.login-footnote {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Streamer switcher (sidebar top) ─────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.streamer-switcher {
  --streamer-list-row-h: 2.75rem;
  --streamer-list-gap: 0.2rem;
  --streamer-list-visible-rows: 6;
  flex-shrink: 0;
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.streamer-switcher__eyebrow,
.streamer-switcher__panel-label {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.streamer-switcher__current-wrap {
  display: grid;
  gap: 0.45rem;
}

.streamer-switcher__panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  min-height: 0;
}

.streamer-switcher__panel-fixed {
  flex-shrink: 0;
  display: grid;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.streamer-switcher__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.streamer-switcher__count {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.streamer-switcher__search-wrap {
  display: grid;
  gap: 0.35rem;
}

.streamer-switcher__search {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.streamer-switcher__search:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.streamer-switcher__search::placeholder {
  color: var(--text-muted);
}

.streamer-switcher__viewport {
  flex-shrink: 0;
  height: calc(
    var(--streamer-list-visible-rows) * var(--streamer-list-row-h) +
    (var(--streamer-list-visible-rows) - 1) * var(--streamer-list-gap) +
    0.7rem
  );
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.14);
}

.streamer-switcher__viewport::-webkit-scrollbar {
  width: 6px;
}

.streamer-switcher__viewport::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.28);
  border-radius: 999px;
}

.streamer-switcher__viewport::-webkit-scrollbar-track {
  background: transparent;
}

.streamer-switcher__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  display: grid;
  gap: var(--streamer-list-gap);
}

.streamer-switcher__item {
  margin: 0;
}

.streamer-switcher__empty {
  display: grid;
  place-items: center;
  min-height: calc(var(--streamer-list-row-h) * 2);
  padding: 1rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.streamer-row {
  width: 100%;
  min-height: var(--streamer-list-row-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.08rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.streamer-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.07);
}

.streamer-row:focus-visible {
  outline: none;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}

.streamer-row__body {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.streamer-row__name {
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.streamer-row__meta {
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.streamer-current {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.1));
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.14);
  min-width: 0;
}

.streamer-current__avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.streamer-current__body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.streamer-current__name {
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.streamer-current__handle {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streamer-current__badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.28);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* ── Sidebar footer ─────────────────────────────────────── */

.sidebar__footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.sidebar__footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar__role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.sidebar__role-badge[data-role='owner'] {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
}

.sidebar__role-badge[data-role='manager'] {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.sidebar__logout {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.sidebar__logout:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ── Sidebar auth (legacy — removed from HTML) ──────────── */

/* ── Sidebar auth (legacy — removed from HTML) ──────────── */

.sidebar__auth {
  display: none;
}

/* ── Diamond accuracy verification ─────────────────────── */
.accuracy-section {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(15, 10, 30, 0.6));
}

.accuracy-banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.accuracy-banner--warn {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.accuracy-banner--conn-warn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.accuracy-banner--conn-warn .accuracy-banner__title {
  color: #fca5a5;
}

.accuracy-banner--conn-ok {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.accuracy-banner--conn-ok .accuracy-banner__title {
  color: #86efac;
}

.accuracy-banner--normal-waiting {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.accuracy-banner--normal-waiting .accuracy-banner__title {
  color: #7dd3fc;
}

.accuracy-banner__line {
  display: block;
  margin-top: 0.25rem;
}

.accuracy-banner__line:first-child {
  margin-top: 0;
}

.accuracy-banner--gift-degraded {
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.45);
}

.accuracy-banner--gift-degraded .accuracy-banner__title {
  color: #fdba74;
}

.accuracy-banner__meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.accuracy-banner__title {
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: #fde68a;
}

.accuracy-banner__body {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.accuracy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.accuracy-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.accuracy-card__title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accuracy-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  font-family: var(--font-display, 'Orbitron', sans-serif);
}

.accuracy-card__value--delta {
  color: #f87171;
}

.accuracy-card__hint,
.accuracy-card__source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.accuracy-card--tiktok {
  border-color: rgba(96, 165, 250, 0.45);
}

.accuracy-card--ws {
  border-color: rgba(167, 139, 250, 0.45);
}

.glance-card__sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.league-stat__meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
