:root {
  color-scheme: dark;
  --bg: #050607;
  --surface: rgba(9, 11, 13, 0.88);
  --surface-strong: rgba(12, 14, 17, 0.96);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f1f0ed;
  --muted: #aaa7a0;
  --red: #d80d13;
  --red-dark: #7f0a0f;
  --gold: #d3a423;
  --gold-dark: #795b10;
  --blue: #2b87ff;
  --blue-dark: #0c3d7a;
  --green: #1e7f3b;
  --purple: #8e45d8;
  --purple-dark: #2a0d3d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.56);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Impact, Haettenschweiler, "Arial Narrow Bold", "Segoe UI Condensed",
    "Roboto Condensed", Arial, sans-serif;
  background:
    radial-gradient(circle at 72% 34%, rgba(76, 130, 158, 0.14), transparent 23rem),
    linear-gradient(rgba(0, 0, 0, 0.9), rgba(5, 6, 7, 0.98)),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

button,
.perk-slot,
.counter-panel,
.roulette-board,
.stats-card,
.challenge-board,
.editor-board {
  border-radius: 8px;
}

button {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  letter-spacing: 0;
  text-align: left;
}

.site-logo {
  justify-content: flex-start;
  min-width: 132px;
}

.site-logo img {
  display: block;
  width: auto;
  max-width: 148px;
  max-height: 38px;
  object-fit: contain;
}

.tally-mini {
  position: relative;
  width: 38px;
  height: 30px;
  margin-right: 8px;
}

.tally-mini::before {
  position: absolute;
  inset: 5px 2px;
  content: "";
  background:
    linear-gradient(75deg, transparent 0 44%, #fff 44% 54%, transparent 54%),
    repeating-linear-gradient(90deg, transparent 0 6px, #fff 6px 9px, transparent 9px 12px);
  opacity: 0.94;
}

.brand-r,
.brand-2,
.brand-p {
  font-size: 2rem;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.brand-r,
.brand-p {
  color: var(--red);
}

.brand-2 {
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 40px;
  margin-left: 16px;
  overflow-x: auto;
}

.nav-link {
  position: relative;
  min-width: 124px;
  padding: 0 14px;
  border: 1px solid #fff;
  border-left: 0;
  background: #fff;
  color: #000;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.88rem;
  text-transform: none;
}

.nav-link::after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  content: "";
  display: none;
  background: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
  background: #080808;
  color: #fff;
}

.nav-link.active::after {
  display: block;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Role-aware active nav underline colors */
.nav-link[data-view="killer"].active::after {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.nav-link[data-view="survivor"].active::after {
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
}

.nav-link[data-view="obs"].active::after {
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
}

.language-select-wrap {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.language-select {
  min-width: 132px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #fff;
  background: #050607;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

.language-select option {
  color: #fff;
  background: #050607;
}

.bug-report-button {
  min-width: 112px;
  min-height: 38px;
  border: 1px solid rgba(142, 69, 216, 0.5);
  background: rgba(142, 69, 216, 0.16);
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.help-button {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(83, 169, 255, 0.48);
  border-radius: 50%;
  color: #b9dcff;
  background: rgba(83, 169, 255, 0.12);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 1000;
}

.app-shell {
  width: min(1240px, calc(100% - 48px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 20px 0 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-view {
  position: relative;
  min-height: calc(100vh - 128px);
  overflow: hidden;
}

.home-view.active {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(360px, 1.14fr);
  align-items: center;
  gap: 22px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-left: 0;
}

.hero-logo {
  display: block;
  max-width: 460px;
  margin-top: 8px;
}

.hero-logo img {
  display: block;
  width: min(100%, 460px);
  height: auto;
  object-fit: contain;
}

.ready-logo {
  display: grid;
  margin-top: 8px;
  color: #f4f1eb;
  font-size: clamp(3rem, 8vw, 5.6rem);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 0.78;
  text-transform: uppercase;
  text-shadow: 0 16px 22px rgba(0, 0, 0, 0.72);
}

.ready-logo > span {
  display: block;
}

.ready-logo span span {
  color: var(--red);
}

.ready-line {
  position: relative;
}

.ready-line::after {
  position: absolute;
  right: 19%;
  top: 12%;
  width: 18%;
  height: 36%;
  content: "";
  background: #f4f1eb;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.play-line {
  position: relative;
}

.play-line::after {
  position: absolute;
  left: 42%;
  top: -26%;
  width: 18%;
  height: 112%;
  content: "";
  background: #050607;
  clip-path: polygon(28% 0, 78% 0, 58% 44%, 94% 44%, 28% 100%, 43% 57%, 0 57%);
  filter: drop-shadow(8px 8px 0 rgba(255, 255, 255, 0.18));
}

.kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  display: grid;
  gap: 0;
  margin: 0;
  max-width: 560px;
  color: #f3f1eb;
  font-size: clamp(3.4rem, 8.5vw, 7rem);
  line-height: 0.78;
  text-transform: uppercase;
  text-shadow: 0 12px 26px rgba(0, 0, 0, 0.9);
}

.hero-copy h1 span:first-child::first-letter,
.hero-copy h1 span:last-child::first-letter {
  color: var(--red);
}

.hero-text {
  max-width: 460px;
  margin: 14px 0 0;
  color: #f1eee8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 16px;
}

.mode-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 216px;
  min-height: 46px;
  padding: 8px 18px;
  border: 1px solid #0d7cff;
  background: #030303;
  box-shadow: none;
  font-family: Consolas, "Courier New", monospace;
  text-transform: none;
}

.mode-card strong {
  max-width: none;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.killer-card {
  border-color: var(--red);
}

.survivor-card {
  border-color: #0d7cff;
}

.compact-action,
.outline-button,
.ghost-button,
.danger-button,
.save-button,
.spin-button,
.wide-reset {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  text-transform: uppercase;
}

.compact-action,
.outline-button,
.ghost-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.compact-action {
  min-width: 170px;
  margin-left: 126px;
  margin-top: 12px;
  border-color: #7aa4bd;
  background: #030303;
  font-family: Consolas, "Courier New", monospace;
}

.hero-figure {
  position: relative;
  min-height: 310px;
}

.hero-banner-image {
  position: absolute;
  inset: 8% 0 8% 0;
  z-index: 2;
  width: 100%;
  height: 84%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  object-position: center;
  filter:
    saturate(0.82)
    contrast(1.08)
    drop-shadow(0 24px 30px rgba(0, 0, 0, 0.72));
  transition:
    opacity 220ms ease,
    transform 520ms ease,
    filter 520ms ease;
}

.hero-banner-image.is-changing {
  opacity: 0.2;
  transform: translateX(10px) scale(0.99);
}

.hero-banner-image.portrait-banner {
  object-fit: contain;
  object-position: center bottom;
  background:
    radial-gradient(circle at 52% 42%, rgba(255, 255, 255, 0.12), transparent 14rem),
    rgba(0, 0, 0, 0.36);
}

.hero-banner-image.killer-banner {
  border-color: rgba(216, 13, 19, 0.26);
  filter:
    saturate(0.9)
    contrast(1.08)
    drop-shadow(0 24px 30px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 24px rgba(216, 13, 19, 0.18));
}

.hero-banner-image.survivor-banner {
  border-color: rgba(43, 135, 255, 0.26);
  filter:
    saturate(0.9)
    contrast(1.08)
    drop-shadow(0 24px 30px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 24px rgba(43, 135, 255, 0.16));
}

.hero-figure::after {
  position: absolute;
  inset: 8% 0 8% 0;
  z-index: 3;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 40%, rgba(0, 0, 0, 0.58)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.52), transparent 35%, rgba(0, 0, 0, 0.36));
}

.spark-field {
  position: absolute;
  right: 20%;
  bottom: 22%;
  width: 260px;
  height: 280px;
  background:
    radial-gradient(circle, rgba(255, 124, 30, 0.9) 0 2px, transparent 3px) 20px 30px / 44px 50px,
    radial-gradient(circle, rgba(216, 13, 19, 0.7) 0 1px, transparent 3px) 4px 6px / 36px 42px;
  opacity: 0.32;
}

.tally-mark,
.circle-mark {
  position: relative;
  flex: 0 0 58px;
  height: 48px;
}

.tally-mark::before {
  position: absolute;
  inset: 6px 6px;
  content: "";
  background:
    linear-gradient(78deg, transparent 0 42%, #eee 42% 53%, transparent 53%),
    repeating-linear-gradient(90deg, transparent 0 9px, #eee 9px 13px, transparent 13px 18px);
  opacity: 0.9;
}

.circle-mark {
  border: 3px solid #ddd;
  border-radius: 50%;
}

.circle-mark::before,
.circle-mark::after {
  position: absolute;
  top: 9px;
  width: 14px;
  height: 28px;
  content: "";
  background: #ddd;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.circle-mark::before {
  left: 12px;
}

.circle-mark::after {
  right: 12px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.page-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.page-title p:not(.kicker) {
  max-width: 820px;
  margin: 8px 0 0;
  color: #c4c1bb;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.role-emblem {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid currentColor;
  color: var(--red);
  font-size: 1.5rem;
  transform: rotate(45deg);
  box-shadow: 0 0 22px color-mix(in srgb, currentColor 30%, transparent);
}

.role-emblem span {
  display: block;
  line-height: 1;
  transform: rotate(-45deg);
}

.role-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  align-items: stretch;
}

.roulette-board,
.counter-panel,
.challenge-board,
.stats-card,
.editor-board {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.roulette-board {
  min-height: 360px;
  padding: 28px 32px;
  text-align: center;
}

.killer-board,
.survivor-board {
  text-align: left;
}

.killer-stage,
.survivor-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 24px;
  align-items: stretch;
}

.perk-zone {
  min-width: 0;
  text-align: center;
}

.killer-stage .perk-diamonds,
.survivor-stage .perk-diamonds {
  grid-template-columns: repeat(4, minmax(66px, 1fr));
  gap: 12px;
}

.killer-stage .perk-slot,
.survivor-stage .perk-slot {
  width: 80px;
}

.killer-stage .perk-slot .perk-content,
.survivor-stage .perk-slot .perk-content {
  font-size: 0.66rem;
}

.killer-portrait-card,
.survivor-portrait-card {
  position: relative;
  display: flex;
  align-self: center;
  height: 310px;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(216, 13, 19, 0.28);
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 13, 19, 0.26), transparent 11rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.48)),
    rgba(6, 7, 8, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 20px 54px rgba(0, 0, 0, 0.42);
}

.survivor-portrait-card {
  border-color: rgba(43, 135, 255, 0.34);
  background:
    radial-gradient(circle at 50% 42%, rgba(43, 135, 255, 0.22), transparent 11rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.48)),
    rgba(6, 7, 8, 0.92);
}

.killer-portrait-card::before,
.survivor-portrait-card::before {
  position: absolute;
  inset: 12px;
  z-index: 0;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(216, 13, 19, 0.2) 46% 47%, transparent 47%),
    linear-gradient(45deg, transparent 0 52%, rgba(255, 255, 255, 0.08) 52% 53%, transparent 53%);
}

.survivor-portrait-card::before {
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(43, 135, 255, 0.18) 46% 47%, transparent 47%),
    linear-gradient(45deg, transparent 0 52%, rgba(255, 255, 255, 0.08) 52% 53%, transparent 53%);
}

.portrait-frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  flex: 1;
  min-height: 208px;
  overflow: hidden;
}

.portrait-frame img {
  position: relative;
  z-index: 2;
  display: none;
  width: min(124%, 268px);
  max-height: 240px;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 16px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 22px rgba(216, 13, 19, 0.18));
}

.killer-portrait-card.has-portrait .portrait-frame img,
.survivor-portrait-card.has-portrait .portrait-frame img {
  display: block;
  animation: portraitReveal 560ms cubic-bezier(0.2, 0.85, 0.18, 1) both;
}

.killer-portrait-card.is-rolling .portrait-frame img,
.survivor-portrait-card.is-rolling .portrait-frame img {
  display: block;
  animation: portraitRoll 95ms steps(2, end) infinite;
}

.portrait-placeholder {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 138px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.28);
  font-size: 5rem;
  transform: rotate(45deg);
}

.portrait-placeholder::first-letter {
  transform: rotate(-45deg);
}

.killer-portrait-card.has-portrait .portrait-placeholder,
.survivor-portrait-card.has-portrait .portrait-placeholder {
  display: none;
}

.killer-portrait-card span,
.killer-portrait-card strong,
.survivor-portrait-card span,
.survivor-portrait-card strong {
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  text-transform: uppercase;
}

.killer-portrait-card span,
.survivor-portrait-card span {
  margin-top: 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
}

.killer-portrait-card strong,
.survivor-portrait-card strong {
  margin-top: 4px;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 0.95;
  text-shadow: 0 0 16px rgba(216, 13, 19, 0.28);
}

.survivor-portrait-card strong {
  text-shadow: 0 0 16px rgba(43, 135, 255, 0.28);
}

.killer-portrait-card.is-rolling strong,
.survivor-portrait-card.is-rolling strong {
  color: var(--red);
  animation: textFlicker 140ms linear infinite;
}

.survivor-portrait-card.is-rolling strong {
  color: var(--blue);
}

.character-carousel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.012)),
    rgba(6, 7, 8, 0.82);
  box-shadow: var(--shadow);
}

.carousel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.carousel-actions .ghost-button {
  min-height: 38px;
}

.character-track {
  display: grid;
  grid-auto-columns: 110px;
  grid-auto-flow: column;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
}

.character-slide {
  display: grid;
  grid-template-rows: 112px auto;
  gap: 6px;
  min-height: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  scroll-snap-align: start;
  text-align: center;
}

.character-slide.active {
  border-color: var(--red);
  background: rgba(216, 13, 19, 0.16);
  box-shadow: 0 0 0 1px rgba(216, 13, 19, 0.28);
}

.survivor-carousel .character-slide.active {
  border-color: var(--blue);
  background: rgba(43, 135, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(43, 135, 255, 0.26);
}

.character-slide img {
  align-self: end;
  justify-self: center;
  width: 100%;
  max-height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.68));
}

.character-slide span {
  align-self: center;
  color: #ede9df;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.roulette-board h3,
.counter-panel h3,
.stats-card h3,
.challenge-board h3 {
  margin: 0;
  color: #bbb7af;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.perk-diamonds {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 16px;
  align-items: start;
  justify-items: center;
  min-height: 168px;
  margin: 18px auto 14px;
}

.perk-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(110px, 100%);
  min-width: 0;
}

.perk-name {
  display: block;
  width: min(132px, 100%);
  min-height: 2.2em;
  color: #d6d1c8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.perk-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: min(92px, 100%);
  aspect-ratio: 1;
  border: 3px solid #bfbfc2;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 62%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(15, 15, 17, 0.96));
  transform: rotate(45deg);
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.5),
    inset 0 0 24px rgba(255, 255, 255, 0.08);
}

.perk-slot.filled.killer-perk {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.22), transparent 42%),
    linear-gradient(135deg, #3e174a, #1a0a20 78%);
}

.perk-slot.filled.survivor-perk {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #1f7c36, #0b2313 78%);
}

.perk-slot .perk-content {
  display: grid;
  place-items: center;
  width: 98%;
  height: 98%;
  padding: 10px;
  color: #f7f4ed;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
  transform: rotate(-45deg);
}

.perk-icon {
  width: 112%;
  height: 112%;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.82))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.16));
}

.perk-diamonds.is-rolling .perk-slot {
  animation: perkSlotRoll 140ms steps(2, end) infinite;
}

.perk-diamonds.is-rolling .perk-icon {
  animation: perkIconFlicker 90ms linear infinite;
}

.perk-diamonds.is-rolling .perk-slot.filled.killer-perk {
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(216, 13, 19, 0.48),
    inset 0 0 24px rgba(255, 255, 255, 0.08);
}

.perk-diamonds.is-rolling .perk-slot.filled.survivor-perk {
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(43, 135, 255, 0.48),
    inset 0 0 24px rgba(255, 255, 255, 0.08);
}

.perk-diamonds.is-revealing .perk-slot {
  animation: perkLand 420ms cubic-bezier(0.18, 0.88, 0.32, 1.04) both;
}

.perk-diamonds.is-revealing .perk-card:nth-child(2) .perk-slot {
  animation-delay: 75ms;
}

.perk-diamonds.is-revealing .perk-card:nth-child(3) .perk-slot {
  animation-delay: 150ms;
}

.perk-diamonds.is-revealing .perk-card:nth-child(4) .perk-slot {
  animation-delay: 225ms;
}

.perk-diamonds.is-revealing .perk-name {
  animation: perkNameReveal 320ms ease both;
}

.perk-diamonds.is-revealing .perk-card:nth-child(2) .perk-name {
  animation-delay: 110ms;
}

.perk-diamonds.is-revealing .perk-card:nth-child(3) .perk-name {
  animation-delay: 185ms;
}

.perk-diamonds.is-revealing .perk-card:nth-child(4) .perk-name {
  animation-delay: 260ms;
}

.perk-slot.empty {
  opacity: 0.35;
  border-style: dashed;
  border-color: rgba(191, 191, 194, 0.38);
}

.chosen-character {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 68px;
  margin: 18px auto 0;
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.chosen-character span {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chosen-character strong {
  font-size: clamp(1.2rem, 2.6vw, 2.1rem);
  text-transform: uppercase;
}

.killer-difficulty {
  width: 100%;
  color: #bfb8ae;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.survivor-item-zone,
.killer-addon-zone {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(43, 135, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
}

.killer-addon-zone {
  border-color: rgba(216, 13, 19, 0.24);
}

.compact-head {
  align-items: center;
}

.compact-head h3 {
  font-size: 1.25rem;
}

.compact-roll {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 0.78rem;
}

.item-loadout {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.killer-addon-loadout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-slot {
  display: grid;
  grid-template-rows: minmax(62px, 1fr) auto;
  place-items: center;
  min-height: 100px;
  padding: 8px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(43, 135, 255, 0.14), transparent 5rem),
    rgba(0, 0, 0, 0.28);
}

.item-slot.item {
  border-color: rgba(43, 135, 255, 0.38);
}

.item-slot img {
  max-width: 76px;
  max-height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.78));
}

.item-slot span {
  color: #ddd7ce;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-align: center;
}

.item-slot small {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.item-slot.empty {
  opacity: 0.42;
}

.item-loadout.is-rolling .item-slot {
  animation: itemRoll 120ms steps(2, end) infinite;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.action-row.centered {
  justify-content: center;
}

.spin-button,
.save-button {
  min-width: 168px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.killer-spin,
.killer-save {
  background: linear-gradient(180deg, #d5191f, #821015);
}

.survivor-spin,
.survivor-save {
  background: linear-gradient(180deg, #4a9bff, #0a3d8f);
}

.purple-spin {
  background: linear-gradient(180deg, #984ddb, #481160);
}

.outline-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  color: #d9d6cf;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.035);
  color: #aaa6a0;
}

.twitch-button {
  background: rgba(145, 71, 255, 0.18);
  color: #c9a8ff;
}

.twitch-button:hover {
  background: rgba(145, 71, 255, 0.34);
  color: #e2cfff;
}

.danger-button {
  background: rgba(216, 13, 19, 0.18);
  color: #ffb8b8;
}

.full-width {
  width: 100%;
}

.counter-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 34px 28px;
  text-align: center;
}

.counter-number {
  display: block;
  margin: 14px 0 18px;
  font-size: 4.2rem;
  line-height: 0.9;
}

.red-number,
.red-text {
  color: var(--red);
}

.gold-number,
.gold-text {
  color: var(--blue);
}

.purple-title .role-emblem,
.purple-title .kicker,
.purple-title h2 {
  color: var(--purple);
}

.killer-theme .page-title h2,
.killer-theme .role-emblem,
.killer-theme .kicker {
  color: var(--red);
}

.survivor-theme .page-title h2,
.survivor-theme .role-emblem,
.survivor-theme .kicker {
  color: var(--blue);
}

.counter-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.counter-line span,
.counter-line strong,
.survivor-breakdown span,
.survivor-breakdown strong,
.history-list small {
  font-family: "Segoe UI", Arial, sans-serif;
}

.counter-line span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.counter-line strong {
  font-size: 1.55rem;
}

.kill-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.kill-selector button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1rem;
}

.kill-selector button.active {
  border-color: var(--red);
  background: rgba(216, 13, 19, 0.2);
  color: #fff;
}

.survivor-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.survivor-breakdown div {
  min-height: 70px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.survivor-breakdown span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.survivor-breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: 1.4rem;
}

.counter-panel > button + button,
.counter-panel .survivor-breakdown + button,
.counter-panel .save-button + button {
  margin-top: 10px;
}

.challenge-board {
  width: min(980px, 100%);
  min-height: 390px;
  margin: 0 auto;
  padding: 54px;
  text-align: center;
}

.challenge-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.challenge-role,
.challenge-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(142, 69, 216, 0.5);
  color: #cf9fff;
  background: rgba(142, 69, 216, 0.12);
  text-transform: uppercase;
}

.challenge-tier {
  min-width: 92px;
  border-color: rgba(211, 164, 35, 0.5);
  color: #ffe28c;
  background: rgba(211, 164, 35, 0.12);
}

.challenge-board strong {
  display: block;
  max-width: 840px;
  margin: 44px auto 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.challenge-board.is-rolling strong {
  animation: challengeTextRoll 95ms steps(2, end) infinite;
}

.stats-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.stats-card {
  padding: 28px 34px;
}

.stats-card dl {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.stats-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.stats-card dt,
.stats-card dd,
.donut-wrap p,
.history-list li {
  font-family: "Segoe UI", Arial, sans-serif;
}

.stats-card dt {
  color: #c7c3bc;
  font-weight: 700;
  text-transform: uppercase;
}

.stats-card dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.killer-summary {
  border-color: rgba(216, 13, 19, 0.34);
}

.survivor-summary {
  border-color: rgba(43, 135, 255, 0.34);
}

.total-summary,
.killer-ratio-card,
.local-profile-card,
.steam-player-card,
.history-card {
  grid-column: 1 / -1;
}

.total-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.donut {
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0deg, var(--gold) 0deg, rgba(255, 255, 255, 0.08) 0deg);
}

.donut::before {
  position: absolute;
  content: "";
}

.donut span {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #f7f4ed;
  background: #101215;
  font-size: 1.2rem;
}

.donut-wrap p {
  max-width: 170px;
  margin: 0;
  color: #c7c3bc;
  font-weight: 800;
  text-transform: uppercase;
}

.killer-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.killer-ratio-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.killer-ratio-item.strong {
  border-color: rgba(45, 184, 95, 0.48);
}

.killer-ratio-item.mid {
  border-color: rgba(235, 190, 64, 0.48);
}

.killer-ratio-item.low {
  border-color: rgba(216, 13, 19, 0.46);
}

.killer-ratio-item img {
  width: 64px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.7));
}

.killer-ratio-item strong,
.killer-ratio-item span,
.killer-ratio-item small {
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
}

.killer-ratio-item strong {
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.killer-ratio-item span {
  margin-top: 4px;
  color: #b9dcff;
  font-weight: 900;
}

.killer-ratio-item small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 170px 170px;
  gap: 12px;
  margin-top: 20px;
}

.profile-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-form input,
.profile-form select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Arial, sans-serif;
}

.profile-form button {
  align-self: end;
  min-width: 0;
  width: 100%;
}

.mmr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mmr-card {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.mmr-card.killer {
  border-color: rgba(216, 13, 19, 0.32);
}

.mmr-card.survivor {
  border-color: rgba(43, 135, 255, 0.32);
}

.mmr-card span,
.mmr-card strong,
.mmr-card small {
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
}

.mmr-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mmr-card strong {
  margin-top: 6px;
  font-size: 2rem;
}

.mmr-card small {
  color: #b9dcff;
  font-weight: 900;
}

.steam-player-card {
  border-color: rgba(83, 169, 255, 0.28);
}

.steam-hint {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
}

.steam-app-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(83, 169, 255, 0.42);
  color: #b9dcff;
  background: rgba(83, 169, 255, 0.1);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.steam-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-top: 22px;
}

.steam-search-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.steam-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Arial, sans-serif;
}

.steam-search input:focus {
  border-color: rgba(83, 169, 255, 0.62);
}

.steam-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: #b9dcff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

.steam-status.error {
  color: #ffb8b8;
}

.steam-result {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.steam-empty-state {
  margin: 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
}

.steam-profile {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.steam-profile img {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(83, 169, 255, 0.35);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.34);
}

.steam-avatar-empty {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(83, 169, 255, 0.22);
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(83, 169, 255, 0.22) 48% 52%, transparent 52%),
    rgba(0, 0, 0, 0.34);
}

.steam-profile span,
.steam-profile small,
.steam-profile a,
.steam-metric span,
.steam-rank-line span,
.steam-warning,
.steam-api-note,
.steam-details summary,
.steam-stat-table,
.steam-achievement-list {
  font-family: "Segoe UI", Arial, sans-serif;
}

.steam-profile span,
.steam-metric span,
.steam-rank-line span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.steam-profile strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.steam-profile small,
.steam-profile a {
  display: inline-flex;
  margin-top: 8px;
  color: #b9dcff;
  font-size: 0.82rem;
  font-weight: 800;
}

.steam-profile a {
  margin-left: 10px;
}

.steam-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.steam-metric,
.steam-rank-line {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.steam-metric strong {
  display: block;
  margin-top: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.steam-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.steam-rank-line {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 82px;
}

.steam-rank-line strong {
  color: #f4f1eb;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.dbd-rank-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 132px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 54%),
    rgba(0, 0, 0, 0.2);
}

.dbd-rank-card.survivor {
  border-color: rgba(43, 135, 255, 0.32);
}

.dbd-rank-card.killer {
  border-color: rgba(216, 13, 19, 0.34);
}

.dbd-rank-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  isolation: isolate;
}

.dbd-rank-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.dbd-rank-fallback {
  display: block;
  width: 78px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.28);
  transform: rotate(45deg);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 58%),
    #1b1d20;
}

.dbd-rank-roman {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.75),
    0 0 12px rgba(255, 255, 255, 0.24);
}

.dbd-rank-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dbd-rank-label,
.dbd-rank-grade,
.dbd-rank-pips {
  font-family: "Segoe UI", Arial, sans-serif;
}

.dbd-rank-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dbd-rank-grade {
  color: #f4f1eb;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.05;
}

.dbd-rank-pips {
  color: #b9dcff;
  font-size: 0.95rem;
  line-height: 1.25;
}

.dbd-rank-pip-bar {
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.dbd-rank-pip-bar > div {
  height: 100%;
  border-radius: 2px;
  background: rgba(185, 220, 255, 0.65);
  transition: width 0.4s ease;
}

.dbd-rank-card.survivor .dbd-rank-pip-bar > div {
  background: rgba(43, 135, 255, 0.8);
}

.dbd-rank-card.killer .dbd-rank-pip-bar > div {
  background: rgba(216, 60, 60, 0.8);
}

.grade-icon {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: #1b1d20;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 1000;
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.08);
}

.grade-icon.ash {
  background: linear-gradient(135deg, #6b7280, #2f3339);
}

.grade-icon.bronze {
  background: linear-gradient(135deg, #9f6a36, #50301c);
}

.grade-icon.silver {
  background: linear-gradient(135deg, #d7dee8, #66707c);
  color: #111;
}

.grade-icon.gold {
  background: linear-gradient(135deg, #ffd76a, #8a5b08);
  color: #170d00;
}

.grade-icon.iridescent {
  background: linear-gradient(135deg, #fff, #b34cff 42%, #16e1ff);
  color: #12031d;
}

.grade-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  color: #fff;
  isolation: isolate;
}

.grade-badge::before {
  position: absolute;
  inset: 5px;
  z-index: -1;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.58);
  transform: rotate(45deg);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 55%),
    #24272b;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.5),
    inset 0 0 18px rgba(255, 255, 255, 0.12);
}

.grade-badge span {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.grade-badge.ash::before {
  border-color: #aeb5bf;
  background: linear-gradient(135deg, #737b86, #2f3339);
}

.grade-badge.bronze::before {
  border-color: #c7894a;
  background: linear-gradient(135deg, #8c5a32, #3b2116);
}

.grade-badge.silver::before {
  border-color: #f2f4f7;
  background: linear-gradient(135deg, #e1e6ee, #6a7480);
}

.grade-badge.gold::before {
  border-color: #ffe18a;
  background: linear-gradient(135deg, #ffd76a, #8a5b08);
}

.grade-badge.iridescent::before {
  border-color: #ffccd9;
  background: linear-gradient(135deg, #ffc0cf, #b20039 52%, #4a0016);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(216, 13, 19, 0.38),
    inset 0 0 18px rgba(255, 255, 255, 0.18);
}

.grade-badge.unknown::before {
  border-color: rgba(255, 255, 255, 0.28);
  background: #1b1d20;
}

.steam-featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.steam-feature-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.steam-feature-card.survivor {
  border-color: rgba(43, 135, 255, 0.28);
}

.steam-feature-card.killer {
  border-color: rgba(216, 13, 19, 0.3);
}

.steam-feature-card img {
  position: absolute;
  right: -10px;
  bottom: -16px;
  width: 92px;
  max-height: 132px;
  object-fit: contain;
  opacity: 0.58;
  pointer-events: none;
}

.steam-feature-card span,
.steam-feature-card strong {
  position: relative;
  z-index: 1;
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
}

.steam-feature-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.steam-feature-card strong {
  max-width: 74%;
  margin-top: 10px;
  color: #f4f1eb;
  font-size: 1rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.steam-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(235, 190, 64, 0.4);
  color: #ffe28c;
  background: rgba(235, 190, 64, 0.08);
  line-height: 1.45;
}

.steam-api-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.steam-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.steam-details summary {
  cursor: pointer;
  color: #f2eee6;
  font-weight: 900;
  text-transform: uppercase;
}

.steam-stat-table,
.steam-achievement-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.steam-stat-row,
.steam-achievement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.86rem;
}

.steam-achievement-row {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
}

.steam-achievement-row img,
.achievement-icon-empty {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.24);
  object-fit: cover;
}

.achievement-icon-empty {
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, 0.14) 46% 54%, transparent 54%),
    rgba(0, 0, 0, 0.24);
}

.steam-stat-row span,
.steam-achievement-row span {
  overflow-wrap: anywhere;
}

.steam-stat-row strong,
.steam-achievement-row strong {
  color: #b9dcff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.92rem;
  text-align: right;
}

.steam-achievement-row.locked {
  opacity: 0.48;
}

.steam-achievement-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.official-stats-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(115deg, rgba(216, 13, 19, 0.08), transparent 36%),
    rgba(0, 0, 0, 0.2);
}

.official-tabs {
  display: flex;
  width: min(490px, 100%);
  min-height: 50px;
  margin: 0 auto 6px;
  background: rgba(0, 0, 0, 0.38);
}

.official-tabs button {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 50px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  color: #d6d2cb;
  background: transparent;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 900;
}

.official-tabs button:last-child {
  border-right: 0;
}

.official-tabs .active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.24);
}

.official-stats-panel h3,
.leaderboard-section h3 {
  margin: 0;
  color: #e8e3da;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.official-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.official-grid.selected {
  grid-template-columns: minmax(0, 1fr);
}

.stats-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stats-source-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.stats-source-card h4 {
  margin: 0;
  color: #f2eee6;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.stats-source-card.survivor {
  border-color: rgba(83, 169, 255, 0.28);
}

.stats-source-card.killer {
  border-color: rgba(216, 13, 19, 0.32);
}

.obs-source-board {
  display: grid;
  gap: 20px;
  padding: 28px;
}

.obs-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.obs-source-card {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 310px;
  padding: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 18%, rgba(139, 65, 219, 0.16), transparent 15rem),
    rgba(0, 0, 0, 0.24);
}

.obs-source-card.killer {
  border-color: rgba(216, 13, 19, 0.34);
}

.obs-source-card.survivor {
  border-color: rgba(43, 135, 255, 0.34);
}

.obs-source-card h3 {
  margin: 10px 0 8px;
  color: #f4f1ea;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.obs-source-card p,
.obs-help-grid span {
  margin: 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
}

.obs-url-label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.obs-url-label span,
.obs-help-grid strong {
  color: #d7d2c8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.obs-url-label input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.42);
  color: #f7f3ec;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.88rem;
}

.obs-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.obs-help-grid > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

/* ── Hotkey panel ─────────────────────────────────────────────────────────── */

.obs-hotkey-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.obs-hotkey-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.obs-hotkey-header strong {
  display: block;
  color: #d7d2c8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hotkey-table {
  width: 100%;
  border-collapse: collapse;
}

.hotkey-table td {
  padding: 6px 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.88rem;
  vertical-align: middle;
}

.hotkey-table td:first-child {
  width: 100%;
}

.hotkey-table td:last-child {
  white-space: nowrap;
  padding-left: 12px;
}

.hotkey-btn {
  display: inline-block;
  min-width: 90px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #e8e4db;
  font-family: "Segoe UI", ui-monospace, monospace;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, color 160ms;
}

.hotkey-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
}

.hotkey-btn.recording {
  border-color: rgba(216, 13, 19, 0.7);
  background: rgba(216, 13, 19, 0.12);
  color: #ff5555;
  animation: hkPulse 800ms ease-in-out infinite alternate;
}

@keyframes hkPulse {
  from { box-shadow: 0 0 0 0   rgba(216, 13, 19, 0.3); }
  to   { box-shadow: 0 0 8px 2px rgba(216, 13, 19, 0.5); }
}

.official-summary {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.official-summary h4,
.leaderboard-card h4 {
  margin: 0 0 6px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
}

.official-summary.survivor {
  border-color: rgba(83, 169, 255, 0.34);
  background: linear-gradient(135deg, rgba(83, 169, 255, 0.12), rgba(0, 0, 0, 0.16));
}

.official-summary.killer {
  border-color: rgba(216, 13, 19, 0.34);
  background: linear-gradient(135deg, rgba(216, 13, 19, 0.15), rgba(0, 0, 0, 0.16));
}

.official-best-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
}

.official-best-portrait {
  position: relative;
  min-height: 140px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.official-best-portrait img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: bottom center;
}

.official-best-portrait span {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 14px;
  background: rgba(216, 13, 19, 0.86);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.official-best-card.survivor .official-best-portrait span {
  background: rgba(31, 99, 145, 0.86);
}

.official-best-card strong,
.official-best-card span,
.official-best-card small,
.official-stat-tile span,
.official-stat-tile strong {
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
}

.official-best-card strong {
  margin-bottom: 8px;
  color: #fff;
  font-size: 1rem;
}

.official-best-card span {
  color: #fff;
  font-weight: 900;
}

.official-best-card small {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.official-stat-tile {
  min-height: 76px;
  padding: 12px 14px;
  border-left: 4px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.24);
}

.official-stat-tile.survivor {
  border-left-color: rgba(83, 169, 255, 0.64);
}

.official-stat-tile.killer {
  border-left-color: rgba(216, 13, 19, 0.76);
}

.official-stat-tile span {
  color: #d4d0c8;
  font-size: 0.84rem;
}

.official-stat-tile strong {
  margin-top: 6px;
  font-size: 1.15rem;
}

.leaderboard-section {
  display: grid;
  gap: 12px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.leaderboard-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.leaderboard-card.killer {
  border-color: rgba(216, 13, 19, 0.34);
}

.leaderboard-card.survivor {
  border-color: rgba(83, 169, 255, 0.34);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Segoe UI", Arial, sans-serif;
}

.leaderboard-row img,
.leaderboard-row i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  object-fit: cover;
}

.leaderboard-row strong {
  overflow-wrap: anywhere;
  color: #d8d4cc;
  font-size: 0.86rem;
}

.leaderboard-row em {
  color: #b9dcff;
  font-style: normal;
  font-weight: 900;
}

.account-board {
  margin-bottom: 24px;
}

.account-form,
.account-link-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.account-link-form {
  grid-template-columns: minmax(0, 1fr) 180px;
  margin-top: 12px;
}

.account-form label,
.account-link-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.account-form input,
.account-link-form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Arial, sans-serif;
}

.account-form button,
.account-link-form button {
  align-self: end;
  min-width: 0;
}

.account-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 12px;
}

.updates-list {
  display: grid;
  gap: 12px;
}

.updates-list article {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.updates-list strong,
.updates-list p {
  display: block;
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

.updates-list p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Changelog entry classes (generated by renderChangelog()) ─────────────── */
.cl-entry {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 4px;
}

.cl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cl-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cl-ver {
  font-size: 0.75rem;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--muted);
  opacity: 0.8;
}

.cl-date {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.65;
  margin-left: auto;
}

.cl-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.cl-body {
  display: block;
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  margin-top: 18px;
}

.history-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-filter,
.history-select-label select {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.history-filter {
  padding: 0 16px;
}

.history-filter.active {
  border-color: var(--purple);
  background: rgba(142, 69, 216, 0.2);
}

.history-select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-select-label select {
  width: 100%;
  padding: 0 10px;
  border-radius: 8px;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.history-stat {
  position: relative;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}

.history-stat img {
  position: absolute;
  right: -10px;
  bottom: -16px;
  width: 86px;
  opacity: 0.38;
  pointer-events: none;
}

.history-stat.killer {
  border-color: rgba(216, 13, 19, 0.34);
}

.history-stat.survivor {
  border-color: rgba(43, 135, 255, 0.34);
}

.history-stat span,
.history-stat small,
.history-stat p,
.history-entry,
.history-entry p,
.history-entry-head,
.history-build {
  font-family: "Segoe UI", Arial, sans-serif;
}

.history-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.history-stat small {
  display: block;
  margin-top: 6px;
  color: #ddd7ce;
  font-weight: 800;
}

.history-stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.history-list {
  display: grid;
  max-height: 460px;
  margin: 18px 0 0;
  padding-left: 22px;
  gap: 10px;
  overflow: auto;
}

.history-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.26);
  color: #eee9df;
  line-height: 1.35;
}

.history-entry.killer {
  border-color: rgba(216, 13, 19, 0.28);
}

.history-entry.survivor {
  border-color: rgba(43, 135, 255, 0.28);
}

.history-entry.outcome-win {
  border-color: rgba(45, 184, 95, 0.56);
  background:
    linear-gradient(90deg, rgba(45, 184, 95, 0.15), rgba(0, 0, 0, 0.24) 34%),
    rgba(0, 0, 0, 0.26);
}

.history-entry.outcome-mid {
  border-color: rgba(235, 190, 64, 0.58);
  background:
    linear-gradient(90deg, rgba(235, 190, 64, 0.16), rgba(0, 0, 0, 0.24) 34%),
    rgba(0, 0, 0, 0.26);
}

.history-entry.outcome-loss {
  border-color: rgba(216, 13, 19, 0.58);
  background:
    linear-gradient(90deg, rgba(216, 13, 19, 0.15), rgba(0, 0, 0, 0.24) 34%),
    rgba(0, 0, 0, 0.26);
}

.history-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.history-entry-head span,
.history-entry-head strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-entry-head .history-role {
  border-color: rgba(142, 69, 216, 0.34);
  color: #d8b4ff;
}

.history-entry p {
  margin: 8px 0 0;
}

.history-entry-layout {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.history-portrait {
  align-self: center;
  justify-self: center;
  width: 76px;
  height: 92px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.1), transparent 3.6rem),
    rgba(0, 0, 0, 0.26);
  object-fit: contain;
}

.history-entry.killer .history-portrait {
  border-color: rgba(216, 13, 19, 0.34);
}

.history-entry.survivor .history-portrait {
  border-color: rgba(43, 135, 255, 0.34);
}

.history-portrait.empty {
  opacity: 0.3;
}

.history-build {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.history-item-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.history-build span {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8d2c8;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-item-line span {
  padding: 5px 8px;
  border: 1px solid rgba(43, 135, 255, 0.22);
  color: #b9dcff;
  background: rgba(43, 135, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.wide-reset {
  display: block;
  min-width: 330px;
  margin: 26px auto 0;
  border-color: rgba(142, 69, 216, 0.45);
  background: linear-gradient(180deg, rgba(142, 69, 216, 0.42), rgba(42, 13, 61, 0.78));
}

.danger-reset {
  border-color: rgba(216, 13, 19, 0.55);
  background: linear-gradient(180deg, rgba(216, 13, 19, 0.5), rgba(72, 8, 12, 0.86));
}

.editor-board {
  padding: 28px;
}

.api-sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(83, 169, 255, 0.28);
  border-radius: 8px;
  background: rgba(83, 169, 255, 0.06);
}

.api-sync-panel h3 {
  margin: 0;
  color: #b9dcff;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.api-sync-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
  line-height: 1.4;
}

.api-sync-panel .outline-button {
  flex: 0 0 auto;
}

.roulette-settings-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(142, 69, 216, 0.34);
  border-radius: 8px;
  background: rgba(142, 69, 216, 0.07);
}

.roulette-settings-panel h3 {
  margin: 0;
  color: #d4bcff;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.roulette-settings-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
  line-height: 1.4;
}

.roulette-duration-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(480px, 100%);
}

.roulette-duration-select,
.roulette-sound-control {
  display: grid;
  gap: 8px;
}

.roulette-duration-select {
  flex: 1 1 260px;
  min-width: 220px;
}

.roulette-sound-control {
  flex: 0 0 150px;
}

.roulette-duration-select span:first-child,
.roulette-sound-control span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.duration-value {
  justify-self: center;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
}

.roulette-duration-select select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.36);
  font: inherit;
  text-transform: uppercase;
}

.roulette-sound-control .outline-button {
  min-height: 44px;
  padding: 0 14px;
}

.roulette-sound-control .outline-button.is-muted {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  text-transform: uppercase;
}

.editor-tab.active {
  border-color: rgba(142, 69, 216, 0.72);
  background: rgba(142, 69, 216, 0.2);
}

.editor-label {
  display: block;
  margin: 22px 0 10px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 340px;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

textarea:focus {
  border-color: rgba(142, 69, 216, 0.75);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 44px;
  border-top: 1px solid var(--line);
  color: #aaa7a0;
  background: rgba(0, 0, 0, 0.46);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

.bug-dialog {
  width: min(620px, calc(100% - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.bug-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.settings-dialog {
  width: min(540px, calc(100% - 28px));
}

.account-settings-view .page-title {
  justify-content: space-between;
}

.settings-page-inner {
  max-width: 540px;
  padding: 28px 24px;
}

.settings-inner {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.settings-avatar-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.settings-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: var(--surface-strong);
  display: grid;
  place-items: center;
}

.settings-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-avatar-fallback {
  font-size: 28px;
  color: var(--muted);
  line-height: 1;
}

.settings-avatar-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 18px;
  font-size: 0.85rem;
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

#settingsProfileForm,
#settingsPasswordForm {
  display: grid;
  gap: 14px;
}

#settingsProfileForm label,
#settingsPasswordForm label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}

#settingsProfileForm input,
#settingsPasswordForm input {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-family: Arial, Helvetica, sans-serif;
}

#settingsProfileForm input:focus,
#settingsPasswordForm input:focus {
  outline: none;
  border-color: var(--purple);
  background: rgba(142, 69, 216, 0.08);
}

.settings-status {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.88rem;
  font-family: Arial, Helvetica, sans-serif;
}

.bug-form {
  display: grid;
  gap: 14px;
  padding: 8px;
}

.bug-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bug-form select,
.bug-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
}

.bug-form select {
  min-height: 42px;
  padding: 0 10px;
}

.bug-form textarea {
  min-height: 160px;
}

.bug-status {
  min-height: 20px;
  margin: 0;
  color: #d7c2ff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
}

/* Fallback when an addon/item icon URL fails to load */
.item-slot.icon-failed img {
  display: none !important;
}

.item-slot.icon-failed::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  content: "?";
  color: rgba(255, 255, 255, 0.38);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
}

@media (max-width: 1080px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 22px 0;
  }

  .main-nav {
    width: 100%;
    min-height: 54px;
    margin-left: 0;
    overflow-x: auto;
  }

  .nav-link {
    min-width: max-content;
  }

  .home-view.active,
  .role-layout,
  .total-summary,
  .official-grid,
  .leaderboard-grid,
  .stats-source-grid,
  .obs-source-grid,
  .obs-help-grid {
    grid-template-columns: 1fr;
  }

  .hero-figure {
    min-height: 380px;
  }

  .role-layout {
    gap: 20px;
  }

  .counter-panel {
    max-width: none;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding-top: 26px;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .perk-diamonds,
  .stats-layout,
  .steam-search,
  .steam-metric-grid,
  .steam-rank-grid,
  .steam-featured-grid,
  .killer-ratio-grid,
  .profile-form,
  .mmr-grid,
  .history-controls,
  .history-summary,
  .account-form,
  .account-actions,
  .account-link-form {
    grid-template-columns: 1fr;
  }

  .killer-stage,
  .survivor-stage {
    grid-template-columns: 1fr;
  }

  .perk-diamonds {
    grid-auto-rows: 154px;
    gap: 18px;
  }

  .killer-stage .perk-diamonds,
  .survivor-stage .perk-diamonds {
    grid-template-columns: 1fr;
  }

  .killer-stage .perk-slot,
  .survivor-stage .perk-slot {
    width: 112px;
  }

  .killer-portrait-card,
  .survivor-portrait-card {
    min-height: 360px;
  }

  .portrait-frame {
    min-height: 250px;
  }

  .roulette-board,
  .counter-panel,
  .challenge-board,
  .stats-card,
  .editor-board {
    padding: 24px;
  }

  .obs-source-card {
    min-height: auto;
    padding: 16px;
  }

  .perk-slot {
    width: 112px;
  }

  .hero-copy h1 {
    font-size: clamp(4.4rem, 24vw, 7rem);
  }

  .hero-actions,
  .api-sync-panel,
  .roulette-settings-panel,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .roulette-duration-control {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .roulette-sound-control {
    flex: 1 1 auto;
  }

  .mode-card,
  .compact-action,
  .spin-button,
  .outline-button,
  .ghost-button,
  .danger-button,
  .save-button,
  .wide-reset {
    width: 100%;
  }

  .compact-action {
    margin-left: 0;
  }
}

@keyframes portraitReveal {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
    filter:
      drop-shadow(0 18px 16px rgba(0, 0, 0, 0.78))
      drop-shadow(0 0 0 rgba(216, 13, 19, 0));
  }

  55% {
    opacity: 1;
    transform: translateY(-8px) scale(1.04);
    filter:
      drop-shadow(0 18px 16px rgba(0, 0, 0, 0.78))
      drop-shadow(0 0 34px rgba(216, 13, 19, 0.48));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes portraitRoll {
  0% {
    opacity: 0.7;
    transform: translateX(-5px) skewX(-2deg);
  }

  100% {
    opacity: 1;
    transform: translateX(5px) skewX(2deg);
  }
}

@keyframes textFlicker {
  0%,
  100% {
    opacity: 0.62;
  }

  50% {
    opacity: 1;
  }
}

@keyframes perkSlotRoll {
  0% {
    filter: brightness(0.78) blur(0.3px);
    transform: rotate(45deg) scale(0.96);
  }

  100% {
    filter: brightness(1.3) blur(0);
    transform: rotate(45deg) scale(1.04);
  }
}

@keyframes perkIconFlicker {
  0%,
  100% {
    opacity: 0.58;
  }

  50% {
    opacity: 1;
  }
}

@keyframes perkLand {
  0% {
    opacity: 0.3;
    transform: rotate(45deg) scale(0.68);
    filter: brightness(2.6) blur(2px);
  }

  55% {
    transform: rotate(45deg) scale(1.07);
    filter: brightness(1.2) blur(0);
  }

  100% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
    filter: brightness(1) blur(0);
  }
}

@keyframes perkNameReveal {
  0% {
    opacity: 0;
    transform: translateY(7px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes itemRoll {
  0% {
    filter: brightness(0.78);
    transform: translateX(-2px) scale(0.98);
  }

  100% {
    filter: brightness(1.24);
    transform: translateX(2px) scale(1.02);
  }
}

@keyframes challengeTextRoll {
  0% {
    opacity: 0.58;
    transform: translateX(-5px) skewX(-2deg);
  }

  100% {
    opacity: 1;
    transform: translateX(5px) skewX(2deg);
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-inline: 14px;
  }

  .site-logo {
    min-width: 104px;
  }

  .site-logo img {
    max-width: 132px;
    max-height: 34px;
  }

  .hero-logo {
    max-width: 360px;
  }

  .brand-r,
  .brand-2,
  .brand-p {
    font-size: 1.35rem;
  }

  .tally-mini {
    width: 30px;
    margin-right: 4px;
  }

  .hero-figure {
    display: none;
  }

  .counter-line,
  .stats-card dl div,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .survivor-breakdown,
  .item-loadout,
  .steam-profile,
  .history-entry-layout {
    grid-template-columns: 1fr;
  }

  .dbd-rank-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    min-height: 112px;
    padding: 14px;
  }

  .dbd-rank-emblem {
    width: 86px;
  }

  .dbd-rank-roman {
    font-size: 1.55rem;
  }

  .history-portrait {
    width: 112px;
  }

  .app-shell {
    width: min(100% - 16px, 620px);
  }

  .roulette-board,
  .counter-panel,
  .challenge-board,
  .stats-card,
  .editor-board {
    padding: 16px;
  }
}

/* ── Admin panel ──────────────────────────────────────────────────────────── */
.admin-view { padding: 24px; max-width: 1100px; margin: 0 auto; }
.admin-title { font-size: 1.6rem; font-weight: 900; margin: 0 0 4px; color: var(--accent, #d80d13); }
.admin-subtitle { color: var(--muted, #888); margin: 0 0 24px; font-size: 0.9rem; }
.admin-panel { background: rgba(255,255,255,0.03); border: 1px solid var(--line, #333); border-radius: 8px; padding: 24px; }
.admin-users-section { margin-top: 0; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-toolbar h3 { margin: 0; font-size: 1rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--line-strong, #444); color: var(--muted, #888); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.72rem; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line, #333); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-row--banned td { opacity: 0.55; }
.admin-email { font-family: "Consolas", monospace; font-size: 0.82rem; }
.admin-loading { color: var(--muted, #888); font-style: italic; padding: 20px !important; text-align: center; }
.admin-error { color: #e05a5a; padding: 20px !important; text-align: center; }
.admin-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.admin-badge--active { background: rgba(90,200,90,0.12); color: #5ac85a; border: 1px solid rgba(90,200,90,0.3); }
.admin-badge--banned { background: rgba(224,90,90,0.12); color: #e05a5a; border: 1px solid rgba(224,90,90,0.3); }
.admin-action-btn { font-size: 0.78rem; padding: 3px 10px; }

/* ── Linked Accounts ──────────────────────────────────────────────────────── */
.linked-accounts-section { margin-top: 8px; }
.linked-accounts-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.linked-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.linked-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line, #333);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s;
}
.linked-card:hover:not(.linked-card--coming-soon) {
  border-color: var(--line-strong, #555);
}
.linked-card--coming-soon { opacity: 0.45; pointer-events: none; }
.linked-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
}
.linked-icon-twitch  { color: #9146ff; }
.linked-icon-steam   { color: #c6d4df; }
.linked-icon-discord { color: #5865f2; }
.linked-icon-youtube { color: #ff0000; }
.linked-icon-kick    { color: #53fc18; }
.linked-card-info { flex: 1; min-width: 0; }
.linked-card-name { display: block; font-weight: 600; font-size: 0.88rem; }
.linked-card-status {
  display: block;
  font-size: 0.76rem;
  color: var(--muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.linked-card-status.linked-status--connected { color: #5ac85a; }
.linked-coming-soon { font-style: italic; }
.linked-card-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.linked-btn { font-size: 0.78rem; padding: 4px 12px; white-space: nowrap; }
.linked-btn--disconnect { color: #e05a5a !important; border-color: rgba(224,90,90,0.4) !important; }
.linked-btn--disconnect:hover { background: rgba(224,90,90,0.1) !important; }



/* ========================================================
   v1.2.0 — Account Modal + Lists Card UI
   ======================================================== */

/* --- Account modal button in header --- */
.account-modal-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.account-modal-button:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

/* --- Modal overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none !important; }

.modal-panel {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Lists toolbar --- */
.lists-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.lists-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lists-filter-tab {
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lists-filter-tab:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.lists-filter-tab.active {
  background: var(--blue, #2b87ff);
  border-color: var(--blue, #2b87ff);
  color: #fff;
}

.lists-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lists-search {
  flex: 1;
  min-width: 140px;
  max-width: 240px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
}
.lists-search::placeholder { color: rgba(255,255,255,0.35); }
.lists-select-btn {
  font-size: 0.8rem;
  padding: 5px 12px;
}

/* --- Lists grid --- */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  min-height: 80px;
}

/* Card shared styles */
.list-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px 6px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
  user-select: none;
  position: relative;
}
.list-card:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); }
.list-card.enabled { border-color: var(--blue, #2b87ff); background: rgba(43,135,255,0.1); }
.list-card.disabled { opacity: 0.38; filter: grayscale(1); }

.list-card-portrait {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: rgba(255,255,255,0.05);
}
.list-card-portrait-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: rgba(255,255,255,0.25);
}

.list-card-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  background: rgba(255,255,255,0.04);
}
.list-card-icon-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: rgba(255,255,255,0.2);
}

.list-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-align: center;
  line-height: 1.2;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-card.disabled .list-card-label { color: rgba(255,255,255,0.45); }

.list-card-check {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue, #2b87ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: 900;
}
.list-card.disabled .list-card-check { display: none; }

/* Perk cards - slightly smaller icon grid */
.lists-grid.perk-grid {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

/* Challenge cards - text-based, full width rows */
.lists-grid.challenge-grid {
  grid-template-columns: 1fr;
}
.list-card.challenge-card {
  flex-direction: row;
  padding: 10px 14px;
  text-align: left;
  gap: 10px;
}
.list-card.challenge-card .list-card-label {
  max-width: none;
  white-space: normal;
  font-size: 0.82rem;
  overflow: visible;
  text-overflow: unset;
}
.list-card-tier {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

/* Lists section loading/empty states */
.lists-grid-loading,
.lists-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255,255,255,0.35);
  padding: 32px 0;
  font-size: 0.9rem;
}


/* ========================================================
   v1.2.1 — Inline challenge strip in roulette boards
   ======================================================== */

/* Inline challenge strip inside killer/survivor roulette boards */
.challenge-inline-strip {
  display: none; /* hidden until a challenge is present */
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 8px 0 4px;
  border-left: 3px solid var(--red, #d80d13);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  min-height: 36px;
}
.challenge-inline-strip.has-challenge {
  display: flex;
}
.challenge-inline-strip.is-rolling {
  display: flex;
  opacity: 0.6;
}
.challenge-strip-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red, #d80d13);
  white-space: nowrap;
}
.challenge-strip-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Survivor board uses blue accent */
.survivor-theme .challenge-inline-strip {
  border-left-color: var(--blue, #2b87ff);
}
.survivor-theme .challenge-strip-label {
  color: var(--blue, #2b87ff);
}


/* ========================================================
   v1.3.0 Phase 2/4 — Prestige, Steam Sync, Match Save
   ======================================================== */

.settings-steam-section,
.settings-prestige-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.prestige-inputs-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.prestige-input-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
}

.prestige-input {
  width: 100px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
}
.prestige-input:focus { outline: 2px solid var(--purple, #8e45d8); border-color: transparent; }

.match-save-panel {
  display: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.match-save-panel.visible { display: block; }

.match-save-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ============================================================
   v2.0 ROULETTE REWORK — Build Mode, Tier Badges, Lock Slots
   ============================================================ */

/* Build mode toggle (Random / Custom) */
.build-mode-toggle {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.build-mode-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.build-mode-option input[type="radio"] {
  accent-color: var(--red);
  cursor: pointer;
}

.killer-board .build-mode-option input[type="radio"] {
  accent-color: var(--red);
}

.survivor-board .build-mode-option input[type="radio"] {
  accent-color: var(--blue);
}

.build-mode-option:has(input:checked) {
  color: var(--text);
}

/* Custom perk locks hint */
.custom-perk-locks {
  padding: 4px 10px;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.lock-hint {
  display: block;
  text-align: center;
}

/* Locked perk slot indicator */
.perk-slot.locked {
  position: relative;
  outline: 2px solid rgba(211, 164, 35, 0.7);
  outline-offset: 2px;
}

.perk-slot.locked::after {
  content: "🔒";
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 10px;
  z-index: 10;
  pointer-events: none;
}

/* Challenge tier badge in the inline strip */
.challenge-tier-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.challenge-tier-badge.tier-easy   { background: rgba(30, 127, 59, 0.35);   color: #5fd87a; }
.challenge-tier-badge.tier-medium { background: rgba(211, 164, 35, 0.35);  color: #f5c842; }
.challenge-tier-badge.tier-hard   { background: rgba(216, 13, 19, 0.35);   color: #ff6b6b; }
.challenge-tier-badge.tier-meme   { background: rgba(142, 69, 216, 0.35);  color: #c080ff; }

/* Stats login gate — hide DBD stats when not logged in */
body:not(.user-logged-in) .dbd-stats-section,
body:not(.user-logged-in) .steam-stats-panel,
body:not(.user-logged-in) .official-stats-section {
  display: none;
}

body:not(.user-logged-in) .stats-login-gate {
  display: flex;
}

.stats-login-gate {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  text-align: center;
  color: var(--muted);
}

.stats-login-gate p { margin: 0; font-size: 0.88rem; }

/* No horizontal scroll at 1920×1080 */
@media (min-width: 1200px) {
  .main-wrap {
    max-width: 1860px;
    padding: 0 20px;
  }
}

/* ── v2.0 Cleanup — Missing role-color overrides ──────────────────────── */

/* Survivor board challenge strip: blue accent */
.survivor-board .challenge-inline-strip {
  border-left-color: var(--blue, #2b87ff);
}
.survivor-board .challenge-strip-label {
  color: var(--blue, #2b87ff);
}

/* Killer board challenge strip: red accent (explicit) */
.killer-board .challenge-inline-strip {
  border-left-color: var(--red, #d80d13);
}
.killer-board .challenge-strip-label {
  color: var(--red, #d80d13);
}

/* Build mode toggle — custom perks lock hint inline */
.custom-perk-locks {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 0;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
}

/* Perk slot hover in custom mode: show pointer */
.perk-slot {
  cursor: default;
}

.survivor-board.custom-mode .perk-slot,
.killer-board.custom-mode .perk-slot {
  cursor: pointer;
}

/* Challenge tier badge in inline strip (main app) */
.challenge-tier-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: middle;
}
.challenge-tier-badge--easy   { background: rgba(30,127,59,.3);  color: #5fd87a; }
.challenge-tier-badge--medium { background: rgba(211,164,35,.3); color: #f5c842; }
.challenge-tier-badge--hard   { background: rgba(216,13,19,.3);  color: #ff6b6b; }
.challenge-tier-badge--meme   { background: rgba(142,69,216,.3); color: #c080ff; }


/* ================================================================
   v2.1 — Login Redesign / Typography / Perk Selector / Layout
   ================================================================ */

/* ── 1. TYPOGRAPHY CLEANUP ─────────────────────────────────────── */
/* Remove excessive bold from non-title elements */

button:not(.spin-button):not(.save-button):not(.login-card__btn),
label,
.steam-hint,
.kicker,
.settings-status,
.challenge-strip-text,
.perk-owner-name,
.steam-status,
.account-status-row p,
.linked-card-status,
.history-entry p,
.settings-avatar-fallback,
.build-mode-option,
.lock-hint,
.admin-subtitle,
td,
.obs-hint,
.obs-url,
.counter-label,
.stat-label,
.challenge-board p {
  font-weight: 400;
}

/* Only titles keep bold */
h1, h2, h3, h4,
.nav-link,
.spin-button,
.save-button,
.site-logo,
.login-card__btn,
.role-emblem,
.hero-text strong,
.perk-slot .perk-name {
  font-weight: 700;
}

/* ── 2. LOGIN CARD (Glassmorphism) ─────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.modal-overlay[hidden] { display: none; }

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg,
    rgba(14, 14, 18, 0.96) 0%,
    rgba(8, 8, 12, 0.98) 100%);
  border: 1px solid rgba(216, 13, 19, 0.28);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 32px 64px rgba(0,0,0,0.72),
    0 0 80px rgba(216,13,19,0.08);
  backdrop-filter: blur(24px);
  padding: 36px 32px 28px;
  animation: loginCardIn 240ms cubic-bezier(.22,1,.36,1) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.55);
  font-size: 18px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.login-card__close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.login-card__header {
  text-align: center;
  margin-bottom: 28px;
}

.login-card__logo {
  height: 36px;
  width: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(216,13,19,0.4));
}

.login-card__badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(216,13,19,0.15);
  border: 1px solid rgba(216,13,19,0.35);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,100,100,0.9);
}

.login-card__status-text {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 16px;
}

/* Form */
.login-card__form,
.login-card__steam-form { display: flex; flex-direction: column; gap: 14px; }

.login-field { display: flex; flex-direction: column; gap: 5px; }

.login-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.login-field__input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 150ms, background 150ms;
  outline: none;
}
.login-field__input::placeholder { color: rgba(255,255,255,0.25); }
.login-field__input:focus {
  border-color: rgba(216,13,19,0.6);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(216,13,19,0.12);
}

/* Buttons */
.login-card__btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 140ms, box-shadow 140ms, opacity 140ms;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-card__btn:hover  { transform: translateY(-1px); }
.login-card__btn:active { transform: translateY(0); opacity: 0.88; }

.login-card__btn--primary {
  background: linear-gradient(135deg, #e8151c 0%, #9a0d12 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(216,13,19,0.35);
}
.login-card__btn--primary:hover { box-shadow: 0 6px 24px rgba(216,13,19,0.5); }

.login-card__btn--twitch {
  background: linear-gradient(135deg, #9146ff 0%, #5a2d9c 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(145,70,255,0.3);
}
.login-card__btn--twitch:hover { box-shadow: 0 6px 22px rgba(145,70,255,0.45); }

.login-card__btn--outline {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.18);
}
.login-card__btn--outline:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.login-card__btn--ghost {
  background: transparent;
  color: rgba(255,100,100,0.7);
  border: 1px solid rgba(216,13,19,0.2);
  font-size: 0.82rem;
}
.login-card__btn--ghost:hover {
  color: rgba(255,100,100,1);
  background: rgba(216,13,19,0.08);
}

/* Divider */
.login-card__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
}
.login-card__divider::before,
.login-card__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* Links row */
.login-card__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-card__link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 140ms;
}
.login-card__link:hover { color: rgba(255,255,255,0.75); }
.login-card__link-sep { color: rgba(255,255,255,0.2); font-size: 0.78rem; }

.login-card__steam-form { margin-top: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ── 3. PERK SELECTOR MODAL ─────────────────────────────────────── */

.perk-selector-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  padding: 16px;
}
.perk-selector-overlay[hidden] { display: none; }

.perk-selector-card {
  width: 100%;
  max-width: 780px;
  max-height: 86vh;
  background: rgba(12,12,16,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: loginCardIn 220ms ease-out both;
}

.perk-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.perk-selector-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.perk-selector-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 150ms;
}
.perk-selector-close:hover { background: rgba(255,255,255,0.14); }

.perk-selector-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.perk-selector-input {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
.perk-selector-input:focus { border-color: rgba(216,13,19,0.5); }

.perk-selector-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.perk-selector-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 130ms, border-color 130ms, transform 130ms;
  text-align: center;
  user-select: none;
}
.perk-selector-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}
.perk-selector-item.selected {
  background: rgba(216,13,19,0.18);
  border-color: rgba(216,13,19,0.6);
  box-shadow: 0 0 12px rgba(216,13,19,0.2);
}
.perk-selector-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
}
.perk-selector-item__name {
  font-size: 0.62rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  line-height: 1.25;
  word-break: break-word;
}
.perk-selector-item.selected .perk-selector-item__name { color: #fff; }

.perk-selector-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  gap: 12px;
}
.perk-selector-hint { font-size: 0.78rem; color: rgba(255,255,255,0.4); font-weight: 400; }
.perk-selector-footer .login-card__btn { width: auto; padding: 10px 28px; }

/* Survivor perk selector uses blue accent */
.perk-selector-overlay.survivor-mode .perk-selector-item.selected {
  background: rgba(43,135,255,0.18);
  border-color: rgba(43,135,255,0.6);
}
.perk-selector-overlay.survivor-mode .login-field__input:focus,
.perk-selector-overlay.survivor-mode .perk-selector-input:focus {
  border-color: rgba(43,135,255,0.5);
}

/* ── 4. 1920x1080 LAYOUT FIX ────────────────────────────────────── */
.app-shell {
  width: 100%;
  max-width: 1860px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.site-header {
  max-width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Prevent horizontal scroll at any viewport */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Roulette boards: full width at large screens */
@media (min-width: 1440px) {
  .roulette-board {
    max-width: 100%;
  }
  .page-title { margin-bottom: 18px; }
}

/* ── 5. OBS FORM minor layout ───────────────────────────────────── */
.obs-url {
  font-size: 0.78rem;
  font-weight: 400;
}


/* ================================================================
   HOTFIX: Remove bold font-weight from list/card/tab elements
   Only h1-h4, .spin-button, .nav-link, .role-emblem keep bold.
   ================================================================ */

/* List card labels */
.list-card-label {
  font-weight: 400 !important;
}

/* Perk names in roulette perk slots */
.perk-name {
  font-weight: 400 !important;
}

/* Filter tabs */
.lists-filter-tab {
  font-weight: 400 !important;
}

/* Checkmark inside list card */
.list-card-check {
  font-weight: 700 !important;
}

/* Challenge tier badge in list */
.list-card-tier {
  font-weight: 400 !important;
}

/* Challenge card label */
.list-card.challenge-card .list-card-label {
  font-weight: 400 !important;
}

/* Lists controls buttons (Select All, Deselect, Export) */
.lists-controls .outline-button,
.lists-controls .ghost-button,
.lists-select-btn {
  font-weight: 400 !important;
}

/* Addon label text in roulette boards */
.addon-label,
.item-label {
  font-weight: 400 !important;
}

/* Settings / editor labels */
.editor-board label,
.settings-view label,
.settings-view p,
.settings-view span {
  font-weight: 400 !important;
}

/* Kicker (subtitle under section header) */
.kicker {
  font-weight: 400 !important;
}

/* Challenge inline strip label (in roulette board) */
.challenge-strip-label {
  font-weight: 600 !important;
}
.challenge-strip-text {
  font-weight: 400 !important;
}

/* Roulette board descriptions */
.page-title p,
.role-view > div > p {
  font-weight: 400 !important;
}

/* OBS section hints */
.obs-hint, .obs-url, .obs-source-hint {
  font-weight: 400 !important;
}

/* Stats descriptions */
.stat-label, .stat-value, .steam-hint, .steam-status {
  font-weight: 400 !important;
}

/* History entries */
.history-entry, .history-entry * {
  font-weight: 400 !important;
}

/* Account modal status text */
.login-card__status-text, .login-card__badge {
  font-weight: 400 !important;
}

/* Admin panel */
.admin-subtitle, td, .admin-table th {
  font-weight: 400 !important;
}

/* Build mode toggle labels */
.build-mode-option {
  font-weight: 400 !important;
}

/* END BOLD RESET */

.lists-count-bar { display:flex; align-items:center; padding:4px 0; }
.lists-count-text { font-size:0.75rem; font-weight:400; color:rgba(255,255,255,0.5); }
.roulette-empty-warning { grid-column:1/-1; text-align:center; padding:24px; color:var(--red,#d80d13); font-size:0.88rem; font-weight:400; border:1px dashed rgba(216,13,19,.35); border-radius:8px; background:rgba(216,13,19,.06); }
