:root {
  --panel: rgba(18, 8, 32, .94);
  --panel2: rgba(255, 255, 255, .07);
  --line: rgba(190, 90, 255, .35);
  --text: #eee9ff;
  --muted: #cbbdf7;
  --good: #67e8a5;
  --bad: #ff6b9a
}

* {
  box-sizing: border-box
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  text-align: center;
  min-height: 100vh;
  background: radial-gradient(circle at center, #0a0014, #000);
  color: var(--text)
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(160, 70, 255, .15), transparent 40%), radial-gradient(circle at 70% 80%, rgba(120, 0, 255, .12), transparent 45%);
  pointer-events: none;
  z-index: -1
}

h1,
h2,
h3 {
  margin: .3em 0
}

p {
  color: var(--muted)
}

button {
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  background: rgba(10, 0, 20, .9);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(160, 70, 255, .2), inset 0 0 10px rgba(80, 0, 120, .3);
  transition: .2s
}

button:hover {
  transform: scale(1.03);
  box-shadow: 0 0 14px rgba(190, 90, 255, .6), 0 0 30px rgba(120, 0, 255, .3)
}

button.secondary {
  background: rgba(255, 255, 255, .07)
}

button.danger {
  border-color: rgba(255, 70, 120, .7)
}

button.small {
  padding: 8px 10px;
  font-size: 14px
}

input,
textarea,
select {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font-size: 15px
}

textarea {
  min-height: 82px;
  resize: vertical
}

label {
  display: block;
  margin: 12px 0 6px;
  color: #efe8ff;
  font-weight: bold;
  text-align: left
}

small {
  color: var(--muted)
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 26px 16px
}

.screen.active {
  display: block
}

.centerScreen {
  display: none;
  min-height: 100vh;
  padding: 26px 16px;
  align-items: center;
  justify-content: center
}

.centerScreen.active {
  display: flex
}

.cardPanel {
  width: min(1060px, 94vw);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 0 35px rgba(140, 40, 255, .18)
}

.topActions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px
}

.deckCard,
.miniCard {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel2);
  text-align: left
}

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

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #e9dcff;
  font-size: 12px;
  margin-right: 5px
}

.formRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

@media(max-width:760px) {
  .formRow {
    grid-template-columns: 1fr
  }
}

.editorLayout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  align-items: start
}

@media(max-width:900px) {
  .editorLayout {
    grid-template-columns: 1fr
  }
}

.hidden {
  display: none !important
}

.notice {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--muted);
  text-align: left
}

.success {
  color: var(--good)
}

.error {
  color: var(--bad)
}

#hud {
  display: none;
  justify-content: space-around;
  gap: 8px;
  padding: 10px;
  font-size: 18px;
  flex-wrap: wrap
}

#timer {
  display: none;
  font-size: 22px
}

.quote {
  font-size: 24px;
  margin: 24px auto;
  font-style: italic;
  max-width: 850px;
  white-space: pre-wrap
}

.mediaBox {
  max-width: 780px;
  margin: 10px auto 20px
}

#gameScreen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px 10px 18px
}

#gameScreen #gameScaleContainer {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform-origin: top center;
  transition: transform .15s ease
}

#gameScreen #hud {
  display: flex;
  width: min(100%, 920px);
  max-width: 100%;
  padding: 12px 14px;
  font-size: clamp(14px, 2.2vw, 18px)
}

#gameScreen #timer {
  display: block;
  font-size: clamp(18px, 2.3vw, 22px);
  width: min(100%, 920px);
  text-align: center
}

#gameScreen #comboShowcase {
  display: block;
  width: min(720px, 94vw);
  margin: 0 auto 8px;
  max-width: 100%
}

#gameScreen .cardPanel {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 20px;
  border-radius: 18px
}

#gameScreen .quote {
  font-size: clamp(20px, 2.6vw, 28px);
  margin: 20px auto;
  max-width: 100%
}

#gameScreen .options {
  max-width: 100%;
  width: min(760px, 100%)
}

#gameScreen .options button {
  padding: 14px 16px;
  font-size: clamp(15px, 2.2vw, 18px)
}

#gameScreen #typedResponseBox {
  max-width: 100%;
  width: min(760px, 100%)
}

#gameScreen #typedAnswerInput {
  font-size: clamp(16px, 2.2vw, 18px)
}

#gameScreen .topActions {
  justify-content: center
}

@media(max-width:760px) {
  #gameScreen.active {
    padding: 10px 8px 14px
  }

  #gameScreen #hud {
    flex-direction: column;
    align-items: center
  }
}

.mediaBox iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 14px
}

.mediaBox audio {
  width: min(100%, 560px)
}

.options {
  display: grid;
  gap: 10px;
  max-width: 650px;
  margin: auto
}

#typedResponseBox {
  display: none;
  max-width: 650px;
  margin: 0 auto
}

#feedback {
  min-height: 42px;
  margin-top: 15px;
  font-weight: bold
}

#comboShowcase {
  display: none;
  position: relative;
  width: min(720px, 94vw);
  margin: 10px auto 18px;
  padding: 14px 18px 18px;
  isolation: isolate;
  transform: skew(-8deg)
}

#comboShowcase:before,
#comboShowcase:after {
  content: "";
  position: absolute;
  inset: -16px -28px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
  transition: .25s
}

#comboShowcase:before {
  background: radial-gradient(circle at 20% 90%, var(--flame1, transparent) 0 9%, transparent 22%), radial-gradient(circle at 38% 92%, var(--flame2, transparent) 0 11%, transparent 25%), radial-gradient(circle at 58% 90%, var(--flame1, transparent) 0 10%, transparent 24%), radial-gradient(circle at 78% 94%, var(--flame2, transparent) 0 12%, transparent 26%);
  animation: flameRoar .55s infinite alternate ease-in-out
}

#comboShowcase:after {
  inset: -8px -14px;
  border-radius: 22px;
  border: 2px solid var(--comboColor, #fff);
  box-shadow: 0 0 28px var(--comboGlow, rgba(255, 255, 255, .45))
}

#comboShowcase.flames:before,
#comboShowcase.flames:after {
  opacity: 1
}

.comboHeader {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 16px;
  line-height: .9;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000, 0 0 18px var(--comboGlow, rgba(255, 255, 255, .4))
}

#comboRank {
  font-size: clamp(54px, 11vw, 112px);
  font-weight: 1000;
  letter-spacing: -6px;
  color: var(--comboColor, #fff);
  -webkit-text-stroke: 3px #050008;
  filter: drop-shadow(0 0 18px var(--comboGlow, rgba(255, 255, 255, .45)))
}

#comboNumber {
  font-size: clamp(40px, 8vw, 86px);
  font-weight: 1000;
  color: var(--numberColor, #fff);
  -webkit-text-stroke: 2px #050008;
  min-width: 96px;
  text-align: left
}

.comboLabel {
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 8px
}

#comboTitle {
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--comboColor, #fff);
  text-shadow: 2px 2px 0 #000, 0 0 12px var(--comboGlow, rgba(255, 255, 255, .35));
  margin: 2px 0 8px;
  transform: skew(8deg)
}

.comboMeterShell {
  position: relative;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .5);
  background: rgba(0, 0, 0, .65);
  overflow: hidden;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .9), 0 0 18px var(--comboGlow, rgba(255, 255, 255, .3))
}

#comboBar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .85), var(--comboColor, #fff));
  border-radius: 999px;
  box-shadow: 0 0 24px var(--comboGlow, rgba(255, 255, 255, .4));
  transition: width .2s
}

.comboMeterShell:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%);
  animation: comboSweep 1.2s infinite linear
}

#comboShowcase.comboPop #comboRank,
#comboShowcase.comboPop #comboNumber {
  animation: comboPop .22s ease
}

#comboShowcase.comboShake {
  animation: comboShake .18s ease-in-out infinite
}

@keyframes comboPop {
  45% {
    transform: rotate(-8deg) scale(1.24)
  }
}

@keyframes comboSweep {
  to {
    transform: translateX(100%)
  }
}

@keyframes comboShake {
  25% {
    transform: skew(-8deg) translate(2px, -1px)
  }

  50% {
    transform: skew(-8deg) translate(-2px, 1px)
  }

  75% {
    transform: skew(-8deg) translate(1px, 2px)
  }
}

@keyframes flameRoar {
  from {
    transform: translateY(5px) scaleY(.9);
    opacity: .72
  }

  to {
    transform: translateY(-5px) scaleY(1.18);
    opacity: 1
  }
}

#particles {
  position: fixed;
  inset: 0;
  pointer-events: none
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: floatUp .9s ease-out forwards
}

@keyframes floatUp {
  to {
    transform: translateY(-120px);
    opacity: 0
  }
}

.leaderboardTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px
}

.leaderboardTable th,
.leaderboardTable td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  text-align: left
}

.leaderboardTable th {
  color: #fff;
  background: rgba(255, 255, 255, .08)
}

.leaderboardTable td {
  color: var(--muted)
}

.podiumRow:first-child td {
  color: #ffd84a;
  font-weight: bold
}

.liveCode {
  font-size: clamp(48px, 10vw, 110px);
  font-weight: 1000;
  letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 0 22px rgba(180, 90, 255, .9), 4px 4px 0 #000
}

.hostQuestion {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.12;
  margin: 24px auto;
  max-width: 1100px;
  white-space: pre-wrap
}

.hostOptionsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px auto;
  max-width: 980px
}

.hostOptionTile,
.playerAnswerTile {
  border-radius: 18px;
  padding: 20px;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, .22);
  background: linear-gradient(135deg, rgba(110, 0, 255, .35), rgba(255, 255, 255, .06));
  font-weight: 900
}

.playerAnswerTile {
  cursor: pointer;
  font-size: 20px
}

.playerAnswerTile:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none
}

.liveStatusPill {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  margin: 4px
}

@media(max-width:720px) {
  .hostOptionsGrid {
    grid-template-columns: 1fr
  }
}

/* Manage Decks + subject search additions */
.filterPanel {
  margin: 18px auto 22px;
  max-width: 920px;
  text-align: left;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .055)
}

.subjectChips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px
}

.subjectChip {
  border-color: rgba(255, 255, 255, .18)
}

.subjectChip.active {
  background: linear-gradient(135deg, rgba(168, 77, 255, .8), rgba(255, 255, 255, .12));
  box-shadow: 0 0 18px rgba(168, 77, 255, .45);
  color: #fff
}

.subjectSection {
  margin: 20px auto;
  text-align: left
}

.subjectSection>h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  margin: 22px 0 12px
}

.subjectSection>h2:after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(190, 90, 255, .5), transparent)
}

.inlineCheck {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  text-align: left
}

.inlineCheck input {
  width: auto
}

.managedCard {
  margin-top: 10px
}

.cardListHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap
}

.optionGrid {
  display: grid;
  gap: 8px
}

.accountBar button {
  margin-left: 8px
}

.deckCard h3,
.miniCard h3 {
  margin-top: 0
}

/* Always-on music + performance / live quiz additions */
.qrWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 12px auto;
  text-align: left
}

.qrCode {
  width: 220px;
  height: 220px;
  background: #fff;
  border: 10px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(255, 255, 255, .25)
}

#liveJoinUrl {
  word-break: break-all;
  color: #fff
}

.correctAnswer {
  border-color: rgba(103, 232, 165, .95) !important;
  background: linear-gradient(135deg, rgba(45, 220, 130, .75), rgba(255, 255, 255, .12)) !important;
  box-shadow: 0 0 28px rgba(103, 232, 165, .75) !important;
  color: #fff
}

.chosenWrong {
  border-color: rgba(255, 107, 154, .95) !important;
  background: linear-gradient(135deg, rgba(255, 45, 95, .55), rgba(255, 255, 255, .08)) !important
}

.chosenCorrect {
  outline: 4px solid rgba(255, 255, 255, .7)
}

.liveJoinPanel {
  text-align: center
}

.performance-low * {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important
}

.performance-low body:before {
  display: none
}

.performance-low button:hover {
  transform: none;
  box-shadow: 0 0 8px rgba(160, 70, 255, .2), inset 0 0 10px rgba(80, 0, 120, .3)
}

.performance-low #particles {
  display: none
}

.performance-low #comboShowcase {
  transform: none
}

.performance-low #comboShowcase:before,
.performance-low #comboShowcase:after {
  display: none
}

.performance-low .comboMeterShell:after {
  display: none
}

.performance-low .cardPanel {
  box-shadow: none
}

.performance-low .deckCard,
.performance-low .miniCard {
  box-shadow: none
}

.performance-low .mediaBox iframe {
  max-height: 55vh
}

body.performance-low:before {
  display: none
}


/* Gamification profile / cosmetics */
.profileHero {
  margin: 14px auto;
  text-align: left
}

.profileHeader {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-start;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(120, 0, 255, .18), rgba(255, 255, 255, .06))
}

.profileAvatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  background: rgba(0, 0, 0, .35);
  border: 3px solid rgba(255, 255, 255, .25);
  box-shadow: 0 0 24px rgba(180, 90, 255, .35);
  overflow: hidden;
  flex: 0 0 auto
}

.profileAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.profileInfo {
  flex: 1
}

.profileTitle {
  font-weight: 800;
  display: inline-block;
}

.xpBar {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, .8);
  margin: 8px 0
}

.xpBar>div {
  height: 100%;
  background: linear-gradient(90deg, #7c3cff, #ffd84a);
  box-shadow: 0 0 16px rgba(255, 216, 74, .65)
}

.profileSection {
  text-align: left;
  margin-top: 18px
}

.cosmeticGrid,
.achievementGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px
}

.cosmeticCard,
.achievementCard {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055)
}

.activeCosmetic {
  border-color: rgba(103, 232, 165, .85);
  box-shadow: 0 0 20px rgba(103, 232, 165, .28)
}

.unlockedAchievement {
  border-color: rgba(255, 216, 74, .8);
  background: linear-gradient(135deg, rgba(255, 216, 74, .16), rgba(255, 255, 255, .055))
}

.xpGainBox {
  margin: 14px auto;
  padding: 14px;
  border: 1px solid rgba(255, 216, 74, .65);
  border-radius: 16px;
  background: rgba(255, 216, 74, .09);
  box-shadow: 0 0 22px rgba(255, 216, 74, .25)
}

.frame-gold .profileAvatar {
  border-color: #ffd84a;
  box-shadow: 0 0 24px rgba(255, 216, 74, .85), 0 0 55px rgba(255, 216, 74, .25)
}

.frame-purplepulse .profileAvatar {
  border-color: #b45cff;
  animation: profilePulse 1.4s infinite alternate;
  box-shadow: 0 0 30px rgba(180, 90, 255, .8)
}

@keyframes profilePulse {
  from {
    transform: scale(1);
    filter: brightness(1)
  }

  to {
    transform: scale(1.04);
    filter: brightness(1.2)
  }
}

.theme-golden-scholar {
  --line: rgba(255, 216, 74, .45);
  --muted: #ffeaa0
}

.theme-void-library {
  --line: rgba(180, 90, 255, .55);
  --text: #f6edff
}

.title-animated {
  display: inline-block;
  position: relative;
  color: var(--titleColor, currentColor);
  text-shadow: 0 0 14px rgba(124, 58, 237, .35);
  font-weight: 900;
}

.title-liquid-drip {
  display: inline-block;
  position: relative;
  color: var(--titleColor, currentColor);
  text-shadow: 0 0 18px rgba(0, 0, 0, .18);
  font-weight: 900;
}

.title-liquid-drip::before,
.title-liquid-drip::after {
  content: '';
  position: absolute;
  bottom: -0.25em;
  width: 0.36em;
  height: 0.36em;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0.6em currentColor, 0.9em 0.35em currentColor;
  opacity: 0.85;
  animation: titleDrip 2.8s ease-in-out infinite;
}

.title-liquid-drip::before {
  left: 18%;
  transform: scaleX(0.9);
  animation-delay: 0s;
}

.title-liquid-drip::after {
  left: 60%;
  width: 0.28em;
  height: 0.28em;
  transform: scaleX(1.1);
  animation-delay: 0.9s;
}

@keyframes titleDrip {

  0%,
  20% {
    transform: translateY(0) scaleY(0.9);
    opacity: 0.7;
  }

  50% {
    transform: translateY(0.55em) scaleY(1.1);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scaleY(0.9);
    opacity: 0.75;
  }
}

/* Superadmin tools */
#superAdminScreen .miniCard {
  margin-bottom: 14px;
}

#superAdminScreen textarea {
  min-height: 72px;
}

#adminCosmeticList .miniCard,
#adminAchievementList .miniCard,
#adminStaffList .miniCard {
  margin-top: 10px;
}

.cosmeticPreview {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .03);
  margin-top: 16px;
}

.cosmeticPreview h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.cosmeticPreviewInner {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f4f4f4;
  font-size: 0.95rem;
}

.cosmeticPreviewInner img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
}

.previewTitle,
.previewTheme,
.previewCardBack,
.previewCombo {
  width: 100%;
  max-width: 300px;
  padding: 18px 20px;
  border-radius: 16px;
  color: white;
  font-weight: 700;
  letter-spacing: .02em;
}

.previewTitle {
  font-size: 1.3rem;
}

.previewTitleText {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1.1;
  padding: 0.2rem 0.4rem;
  position: relative;
}

.previewFrame {
  width: 180px;
  height: 180px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  position: relative;
}

.previewFrameAvatar {
  width: 110px;
  height: 110px;
  background: rgba(0, 0, 0, .2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.previewTheme {
  padding: 26px 20px;
}

.previewCardBack {
  height: 140px;
  display: grid;
  place-items: center;
}

.previewCombo {
  height: 80px;
  display: grid;
  place-items: center;
}

.previewNote {
  margin-top: 10px;
  font-size: 0.87rem;
  opacity: .85;
}

@keyframes previewPulse {

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

  50% {
    transform: scale(1.04);
  }
}

@keyframes previewSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#superAdminButton {
  border-color: rgba(255, 216, 74, .65);
  box-shadow: 0 0 16px rgba(255, 216, 74, .22), inset 0 0 10px rgba(255, 216, 74, .08);
}

/* ================= DYNAMIC PROFILE FRAME DESIGNER ================= */

.profileHeader.dynamicFrame {
  --frame1: #8b5cf6;
  --frame2: #22d3ee;
  --frameGlow: #a855f7;
  --frameThickness: 4px;
  --frameSpeed: 2s;
}

.profileHeader.dynamicFrame .profileAvatar {
  position: relative;
  border: var(--frameThickness) solid var(--frame1);
  box-shadow:
    0 0 16px var(--frameGlow),
    0 0 34px color-mix(in srgb, var(--frameGlow), transparent 45%);
  overflow: visible;
  z-index: 1;
}

.profileHeader.dynamicFrame .profileAvatar img,
.profileHeader.dynamicFrame .profileAvatar {
  border-radius: 50%;
}

/* Pulse effect */
.profileHeader.dynamicFrame.frameEffect-pulse .profileAvatar {
  animation: dynamicFramePulse var(--frameSpeed) infinite ease-in-out;
}

/* Spinning gradient ring */
.profileHeader.dynamicFrame.frameEffect-spin .profileAvatar::before,
.profileHeader.dynamicFrame.frameEffect-rainbow .profileAvatar::before,
.profileHeader.dynamicFrame.frameEffect-sparkle .profileAvatar::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

/* Spin */
.profileHeader.dynamicFrame.frameEffect-spin .profileAvatar::before {
  background: conic-gradient(from 0deg,
      var(--frame1),
      var(--frame2),
      var(--frame1));
  animation: dynamicFrameSpin var(--frameSpeed) linear infinite;
}

/* Rainbow */
.profileHeader.dynamicFrame.frameEffect-rainbow .profileAvatar::before {
  background: conic-gradient(red,
      orange,
      yellow,
      lime,
      cyan,
      blue,
      violet,
      red);
  animation: dynamicFrameSpin var(--frameSpeed) linear infinite;
}

/* Sparkle */
.profileHeader.dynamicFrame.frameEffect-sparkle .profileAvatar::before {
  background:
    radial-gradient(circle at 20% 20%, white 0 4px, transparent 5px),
    radial-gradient(circle at 80% 30%, var(--frame2) 0 5px, transparent 6px),
    radial-gradient(circle at 40% 85%, white 0 4px, transparent 5px),
    radial-gradient(circle at 70% 75%, var(--frame1) 0 5px, transparent 6px);
  filter: drop-shadow(0 0 8px var(--frameGlow));
  animation: dynamicFrameSparkle var(--frameSpeed) infinite ease-in-out;
}

/* Flame glow */
.profileHeader.dynamicFrame.frameEffect-flame .profileAvatar {
  box-shadow:
    0 0 18px var(--frameGlow),
    0 0 38px var(--frame1),
    0 0 70px var(--frame2);
  animation: dynamicFrameFlame var(--frameSpeed) infinite alternate ease-in-out;
}

/* Electric glow */
.profileHeader.dynamicFrame.frameEffect-electric .profileAvatar {
  box-shadow:
    0 0 12px white,
    0 0 28px var(--frame1),
    0 0 52px var(--frame2);
  animation: dynamicFrameElectric calc(var(--frameSpeed) / 2) infinite steps(2, end);
}

@keyframes dynamicFramePulse {

  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.05);
    filter: brightness(1.25);
  }
}

@keyframes dynamicFrameSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dynamicFrameSparkle {

  0%,
  100% {
    opacity: .45;
    transform: scale(.95) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.08) rotate(20deg);
  }
}

@keyframes dynamicFrameFlame {
  from {
    filter: brightness(1);
    transform: scale(1);
  }

  to {
    filter: brightness(1.35);
    transform: scale(1.04);
  }
}

@keyframes dynamicFrameElectric {

  0%,
  100% {
    filter: brightness(1);
    transform: translate(0, 0);
  }

  50% {
    filter: brightness(1.6);
    transform: translate(1px, -1px);
  }
}

/* Respect low performance mode */
body.performance-low .profileHeader.dynamicFrame .profileAvatar,
body.performance-low .profileHeader.dynamicFrame .profileAvatar::before {
  animation: none !important;
}

/* ================= FRAME EFFECT PATCH: reliable dynamic avatar frames =================
   These overrides keep generated frame effects visible above the profile card background,
   while keeping the avatar image/text above the animated ring. */
.profileHeader.dynamicFrame {
  position: relative;
  overflow: visible;
}

.profileHeader.dynamicFrame .profileAvatar {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.profileHeader.dynamicFrame .profileAvatar::before {
  z-index: 0 !important;
}

.profileHeader.dynamicFrame .profileAvatar img,
.profileHeader.dynamicFrame .profileAvatar .avatarInner {
  position: relative;
  z-index: 2;
}

.profileHeader.dynamicFrame .profileAvatar img {
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
}

.cosmeticFramePreview {
  max-width: 160px;
  min-height: 130px;
  margin: 0 auto 10px;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 12px;
}

.cosmeticFramePreview .profileAvatar {
  width: 74px;
  height: 74px;
  font-size: 38px;
}

body.performance-low .profileHeader.dynamicFrame .profileAvatar::before,
body.performance-low .cosmeticFramePreview .profileAvatar::before {
  animation: none !important;
}

/* ================= COSMETIC PLAYER IDENTITIES ================= */
.cosmeticLeaderboard td { vertical-align: middle; }
.rankCell { font-weight: 900; color: #fff; text-align: center; }
.playerIdentity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}
.playerIdentity.compactIdentity { min-width: 190px; gap: 9px; }
.identityAvatarWrap.profileHeader {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  width: auto;
  min-width: 0;
  box-shadow: none;
  overflow: visible;
}
.identityAvatar.profileAvatar {
  width: 58px;
  height: 58px;
  font-size: 28px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.22), transparent 35%),
    linear-gradient(135deg, rgba(139,92,246,.45), rgba(34,211,238,.22)),
    rgba(0,0,0,.42);
}
.compactIdentity .identityAvatar.profileAvatar { width: 46px; height: 46px; font-size: 22px; }
.identityAvatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatarInitial { font-weight: 1000; color: #fff; text-shadow: 0 0 12px rgba(180,90,255,.8); }
.identityText { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.1; }
.identityName { color: #fff; font-size: 15px; }
.identityTitle { font-size: 12px; }
.identityLevel { font-size: 11px; color: var(--muted); }
.leaderboardTable .playerIdentity p { margin: 0; }
.livePlayerFinalBoard { display: grid; gap: 10px; margin: 14px auto; max-width: 760px; }
.finalBoardRow {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.finalBoardRow:nth-child(1) { border-color: rgba(255,216,74,.8); box-shadow: 0 0 20px rgba(255,216,74,.18); }
.finalBoardRow:nth-child(2) { border-color: rgba(210,220,255,.65); }
.finalBoardRow:nth-child(3) { border-color: rgba(255,160,90,.65); }
@media(max-width:760px){
  .playerIdentity { min-width: 0; }
  .identityAvatar.profileAvatar { width: 44px; height: 44px; font-size: 21px; }
  .identityLevel { display:none; }
  .finalBoardRow { grid-template-columns: 28px 1fr; }
  .finalBoardRow > span:not(.rankCell), .finalBoardRow > strong { grid-column: 2; justify-self: start; }
}


/* Superadmin Excel deck import */
.excelImportGuide {
  margin: 12px 0;
  line-height: 1.5;
}
#adminExcelImportMessage.success,
#adminExcelImportMessage.error,
#adminExcelImportMessage.notice {
  margin-top: 10px;
  font-weight: 800;
}

/* === Boss-clear cosmetic rewards (Mordred + Phantom) === */
.cosmeticCard.bossRewardCosmetic {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 216, 74, .28);
  background: linear-gradient(145deg, rgba(255, 216, 74, .07), rgba(255, 255, 255, .045));
}

.cosmeticCard.specialBossRewardCosmetic {
  border-color: rgba(255, 216, 74, .62);
  box-shadow: inset 0 0 28px rgba(255, 216, 74, .06);
}

.cosmeticCard.lockedCosmetic {
  border-style: dashed;
  filter: saturate(.58);
}

.cosmeticCard.lockedCosmetic > *:not(.cosmeticLockMark) {
  opacity: .66;
}

.cosmeticLockMark {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 19px;
  opacity: .9;
}

.bossRewardBadge {
  display: inline-block;
  white-space: normal;
  margin: 8px 6px 8px 0;
  line-height: 1.25;
}

.lockedRewardBadge {
  background: rgba(0, 0, 0, .28);
}

.specialBossRewardBadge {
  font-weight: 800;
  box-shadow: 0 0 14px rgba(255, 216, 74, .22);
}

.cosmeticLockedButton[disabled] {
  cursor: not-allowed;
  opacity: .58;
}

.cosmeticAvatarPreview {
  width: 82px;
  height: 82px;
  margin: 2px auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .24);
  background: rgba(0, 0, 0, .3);
  box-shadow: 0 0 18px rgba(0, 0, 0, .32);
}

.cosmeticAvatarPreview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cosmeticMusicPreview {
  margin: 10px 0 2px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  font-size: .84rem;
}

.bossTitlePreview {
  margin: 2px 0 10px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Boss-clear titles -------------------------------------------------------
   V4: these are intentionally high-visibility reward treatments. The JS also
   derives these classes from the cosmetic KEY, so old DB rows cannot make them
   silently render as plain text.
*/
.boss-title-mordred,
.boss-title-phantom,
.boss-title-mordred-legendary,
.boss-title-jabberwock-legendary,
.boss-title-phantom-legendary {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  isolation: isolate;
}

/* Easy — restrained but unmistakably boss-specific. */
.boss-title-mordred {
  padding: .18em .58em .2em 1.58em !important;
  border-radius: 7px !important;
  border: 1px solid rgba(219,70,54,.48) !important;
  color: #ffd0c5 !important;
  background: linear-gradient(105deg, rgba(36,5,8,.92), rgba(75,9,12,.76)) !important;
  box-shadow: inset 0 0 10px rgba(255,58,29,.12), 0 0 9px rgba(163,18,18,.28) !important;
  text-shadow: 0 0 7px rgba(255,69,42,.65) !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
}
.boss-title-mordred::before {
  content: '⚔';
  position: absolute;
  left: .38em;
  color: #ff6c4d;
  filter: drop-shadow(0 0 5px rgba(255,41,18,.85));
}

.boss-title-phantom {
  padding: .18em .62em .2em 1.55em !important;
  border-radius: 7px !important;
  border: 1px solid rgba(225,198,131,.48) !important;
  color: #fff0c8 !important;
  background: linear-gradient(105deg, rgba(22,13,24,.92), rgba(58,34,57,.78)) !important;
  box-shadow: inset 0 0 10px rgba(255,239,189,.1), 0 0 9px rgba(167,116,178,.22) !important;
  text-shadow: 0 0 7px rgba(239,210,139,.52) !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-weight: 900 !important;
  letter-spacing: .06em !important;
}
.boss-title-phantom::before {
  content: '♪';
  position: absolute;
  left: .4em;
  color: #efd48d;
  filter: drop-shadow(0 0 5px rgba(255,236,170,.72));
}

/* HARD — CROWNED IN RUINFLAME. The whole badge breathes with hot/cold fire,
   the crown flickers, and a moving ember seam crosses the plate. */
.boss-title-mordred-legendary {
  padding: .28em .85em .3em 2.05em !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,102,61,.9) !important;
  border-radius: 999px !important;
  color: #fff4df !important;
  background: linear-gradient(110deg,#120305 0%,#4a070b 27%,#160306 47%,#74110b 68%,#120305 100%) !important;
  background-size: 240% 100% !important;
  font-weight: 1000 !important;
  letter-spacing: .065em !important;
  text-shadow: 0 0 3px #ffe0ae,0 0 9px #ff5a2b,0 0 18px rgba(179,0,0,.9) !important;
  box-shadow: inset 0 0 13px rgba(255,105,46,.2),0 0 9px rgba(255,58,27,.62),0 0 24px rgba(172,0,0,.55) !important;
  animation: bossMordredPlate 1.15s ease-in-out infinite alternate, bossMordredFlow 3.2s linear infinite !important;
}
.boss-title-mordred-legendary::before {
  content: '♛';
  position: absolute;
  z-index: 3;
  left: .52em;
  top: 50%;
  transform: translateY(-50%);
  color: #ffc168;
  font-size: 1.15em;
  text-shadow: 0 0 5px #ff421e,0 0 13px #ff210b,0 0 22px #a80000;
  animation: bossMordredCrown .58s steps(2,end) infinite !important;
}
.boss-title-mordred-legendary::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -75%;
  bottom: -75%;
  width: 28%;
  left: -35%;
  transform: rotate(18deg);
  background: linear-gradient(90deg,transparent,rgba(255,88,36,.05),rgba(255,165,80,.78),rgba(255,30,12,.08),transparent);
  animation: bossMordredEmberSweep 2.05s ease-in-out infinite !important;
}
@keyframes bossMordredPlate {
  from { transform: translateY(0) scale(1); filter: brightness(.92) saturate(.95); box-shadow: inset 0 0 10px rgba(255,105,46,.15),0 0 7px rgba(255,58,27,.42),0 0 17px rgba(172,0,0,.36); }
  to { transform: translateY(-1px) scale(1.025); filter: brightness(1.18) saturate(1.28); box-shadow: inset 0 0 17px rgba(255,140,68,.28),0 0 15px rgba(255,75,30,.92),0 0 34px rgba(190,0,0,.72); }
}
@keyframes bossMordredFlow { to { background-position: 240% 0; } }
@keyframes bossMordredCrown {
  0%,100% { opacity:.72; transform:translateY(-50%) rotate(-8deg) scale(.92); }
  50% { opacity:1; transform:translateY(-55%) rotate(6deg) scale(1.15); }
}
@keyframes bossMordredEmberSweep {
  0%,16% { left:-35%; opacity:0; }
  30% { opacity:1; }
  78% { opacity:.85; }
  100% { left:112%; opacity:0; }
}

/* HARD — O FRABJOUS DAY! Rainbow shimmer, animated colour drift, and a sword icon.
   Intentionally unlike Crowned in Ruinflame. */
.boss-title-jabberwock-legendary {
  padding: .28em .92em .3em 2.08em !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.68) !important;
  border-radius: 999px !important;
  color: #fffdf6 !important;
  background: linear-gradient(110deg,#ff4d6d 0%,#ff9f1c 18%,#ffe66d 36%,#38d9a9 54%,#4dabf7 72%,#9775fa 88%,#ff4d6d 100%) !important;
  background-size: 260% 100% !important;
  font-weight: 1000 !important;
  letter-spacing: .065em !important;
  text-shadow: 0 0 4px rgba(255,255,255,.92),0 0 10px rgba(153,112,255,.52) !important;
  box-shadow: inset 0 0 14px rgba(255,255,255,.16),0 0 10px rgba(255,255,255,.28),0 0 26px rgba(133,94,255,.32) !important;
  animation: bossJabberGlow 2.4s ease-in-out infinite, bossJabberFlow 5s linear infinite !important;
}
.boss-title-jabberwock-legendary::before {
  content: '⚔';
  position: absolute;
  z-index: 3;
  left: .54em;
  top: 50%;
  transform: translateY(-50%);
  color: #fff6db;
  font-size: 1.1em;
  text-shadow: 0 0 6px rgba(255,255,255,.95),0 0 14px rgba(122,97,255,.72);
  animation: bossJabberSword 1.8s ease-in-out infinite !important;
}
.boss-title-jabberwock-legendary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.26) 48%,rgba(255,255,255,0) 100%);
  transform: translateX(-135%) skewX(-18deg);
  animation: bossJabberSweep 2.8s ease-in-out infinite !important;
}
@keyframes bossJabberFlow { to { background-position: 260% 0; } }
@keyframes bossJabberGlow {
  0%,100% { transform: translateY(0) scale(1); filter: brightness(.97) saturate(1); }
  50% { transform: translateY(-1px) scale(1.03); filter: brightness(1.12) saturate(1.14); }
}
@keyframes bossJabberSword {
  0%,100% { transform: translateY(-50%) rotate(-10deg) scale(.95); opacity: .82; }
  50% { transform: translateY(-50%) rotate(7deg) scale(1.13); opacity: 1; }
}
@keyframes bossJabberSweep {
  0%,18% { transform: translateX(-135%) skewX(-18deg); opacity: 0; }
  32% { opacity: .8; }
  72% { opacity: .38; }
  100% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
}

/* HARD — ANGEL OF MUSIC. Ivory/gold glow, a floating note and a very visible
   theatrical spotlight sweep. */
.boss-title-phantom-legendary {
  padding: .28em .9em .3em 2.05em !important;
  overflow: hidden !important;
  border: 1px solid rgba(250,224,157,.95) !important;
  border-radius: 999px !important;
  color: #fff7df !important;
  background: linear-gradient(112deg,#120b14 0%,#3a203e 30%,#1b101d 48%,#5c4230 69%,#120b14 100%) !important;
  background-size: 230% 100% !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-weight: 1000 !important;
  letter-spacing: .085em !important;
  text-shadow: 0 0 3px #fffbe9,0 0 9px #edcf82,0 0 19px rgba(158,84,177,.8) !important;
  box-shadow: inset 0 0 14px rgba(255,239,192,.16),0 0 9px rgba(241,213,148,.52),0 0 25px rgba(116,60,133,.5) !important;
  animation: bossPhantomBreath 1.8s ease-in-out infinite, bossPhantomFlow 4s linear infinite !important;
}
.boss-title-phantom-legendary::before {
  content: '♬';
  position: absolute;
  z-index: 3;
  left: .55em;
  top: 50%;
  color: #ffe7a6;
  font-size: 1.12em;
  text-shadow: 0 0 5px #fffce8,0 0 14px #dcb666;
  animation: bossPhantomNote 1.25s ease-in-out infinite !important;
}
.boss-title-phantom-legendary::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: -110%;
  bottom: -110%;
  width: 25%;
  left: -35%;
  transform: rotate(17deg);
  background: linear-gradient(90deg,transparent,rgba(255,255,235,.05),rgba(255,251,219,.92),rgba(255,255,235,.08),transparent);
  mix-blend-mode: screen;
  animation: bossPhantomSpotlight 2.25s cubic-bezier(.45,.05,.55,.95) infinite !important;
}
@keyframes bossPhantomBreath {
  0%,100% { transform:translateY(0) scale(1); filter:brightness(.94); box-shadow:inset 0 0 10px rgba(255,239,192,.12),0 0 7px rgba(241,213,148,.38),0 0 17px rgba(116,60,133,.32); }
  50% { transform:translateY(-1px) scale(1.025); filter:brightness(1.16); box-shadow:inset 0 0 18px rgba(255,244,206,.26),0 0 14px rgba(249,222,153,.78),0 0 34px rgba(133,70,151,.68); }
}
@keyframes bossPhantomFlow { to { background-position:230% 0; } }
@keyframes bossPhantomNote {
  0%,100% { transform:translateY(-48%) rotate(-8deg) scale(.94); opacity:.75; }
  50% { transform:translateY(-70%) rotate(8deg) scale(1.15); opacity:1; }
}
@keyframes bossPhantomSpotlight {
  0%,12% { left:-35%; opacity:0; }
  28% { opacity:.92; }
  72% { opacity:.8; }
  90%,100% { left:115%; opacity:0; }
}

/* Force legendary effects to remain animated in Fancy Flashcards' own low-
   performance mode. These reward titles are intentionally lightweight. */
body.performance-low .boss-title-mordred-legendary,
body.performance-low .boss-title-jabberwock-legendary,
body.performance-low .boss-title-phantom-legendary,
body.performance-low .boss-title-mordred-legendary::before,
body.performance-low .boss-title-mordred-legendary::after,
body.performance-low .boss-title-jabberwock-legendary::before,
body.performance-low .boss-title-jabberwock-legendary::after,
body.performance-low .boss-title-phantom-legendary::before,
body.performance-low .boss-title-phantom-legendary::after {
  animation-play-state: running !important;
}


/* ===== The Kindly Mask / King reward cosmetics — V7.9.5 ===== */
.title-king-yellow-question,
.title-king-yellow-bearer {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  isolation: isolate !important;
}

/* EASY / INVITATION — oracle cyan + antique gold. Static, but as visibly bespoke
   as the Mordred/Phantom easy titles. */
.title-king-yellow-question {
  padding: .19em .64em .21em 1.72em !important;
  border-radius: 7px !important;
  border: 1px solid rgba(98,239,247,.82) !important;
  color: #ecffff !important;
  background: linear-gradient(108deg,#031517 0%,#0a4147 48%,#4a3a08 100%) !important;
  box-shadow: inset 0 0 12px rgba(79,232,240,.16),0 0 10px rgba(56,223,235,.42),0 0 18px rgba(226,190,55,.18) !important;
  text-shadow: 0 0 4px #dfffff,0 0 10px rgba(73,231,240,.72),1px 1px 0 #5b4810 !important;
  font-family: Georgia,'Times New Roman',serif !important;
  font-weight: 950 !important;
  letter-spacing: .07em !important;
}
.title-king-yellow-question::before {
  content: '◉';
  position: absolute;
  left: .45em;
  top: 50%;
  transform: translateY(-50%);
  color: #ffe16a;
  font-size: 1.05em;
  text-shadow: 0 0 5px #fff3a1,0 0 10px rgba(86,236,243,.9),0 0 16px rgba(228,188,47,.55);
  filter: drop-shadow(0 0 3px rgba(86,236,243,.75));
}

/* HARD / CARCOSA — a continuously animated Yellow-Sign plate. */
.title-king-yellow-bearer {
  padding: .29em .92em .31em 2.16em !important;
  overflow: hidden !important;
  border: 1px solid #ffe36a !important;
  border-radius: 999px !important;
  color: #fff9d8 !important;
  background: linear-gradient(112deg,#050605 0%,#4d4008 24%,#07191b 45%,#89710c 66%,#080805 100%) !important;
  background-size: 280% 100% !important;
  font-family: Georgia,'Times New Roman',serif !important;
  font-weight: 1000 !important;
  letter-spacing: .085em !important;
  text-shadow: 0 0 3px #fffbd9,0 0 9px #f6d64d,0 0 18px rgba(46,226,238,.58),2px 0 0 rgba(45,228,239,.18),-2px 0 0 rgba(244,207,60,.18) !important;
  box-shadow: inset 0 0 16px rgba(255,225,91,.18),0 0 10px rgba(247,211,65,.64),0 0 28px rgba(34,206,218,.34) !important;
  animation: kingBearerBreathV6 1.35s ease-in-out infinite,kingBearerFlowV6 3.1s linear infinite !important;
}
.title-king-yellow-bearer::before {
  content: '⌬';
  position: absolute;
  z-index: 3;
  left: .57em;
  top: 50%;
  color: #ffe56e;
  font-size: 1.18em;
  text-shadow: 0 0 4px #fff7b0,0 0 12px #e6bd25,0 0 19px rgba(53,231,241,.78);
  animation: kingBearerSigilV6 1.8s linear infinite !important;
}
.title-king-yellow-bearer::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: -120%;
  bottom: -120%;
  width: 26%;
  left: -38%;
  transform: rotate(16deg);
  background: linear-gradient(90deg,transparent,rgba(61,235,244,.12),rgba(255,239,133,.96),rgba(50,229,240,.42),transparent);
  mix-blend-mode: screen;
  animation: kingBearerSweepV6 1.9s cubic-bezier(.45,.05,.55,.95) infinite !important;
}
@keyframes kingBearerBreathV6 {
  0%,100% { transform:translateY(0) scale(1); filter:brightness(.92) saturate(.95); }
  50% { transform:translateY(-1px) scale(1.035); filter:brightness(1.22) saturate(1.28); }
}
@keyframes kingBearerFlowV6 { to { background-position:280% 0; } }
@keyframes kingBearerSigilV6 {
  0% { transform:translateY(-50%) rotate(0deg) scale(.92); filter:hue-rotate(0deg); }
  50% { transform:translateY(-50%) rotate(180deg) scale(1.16); filter:hue-rotate(18deg); }
  100% { transform:translateY(-50%) rotate(360deg) scale(.92); filter:hue-rotate(0deg); }
}
@keyframes kingBearerSweepV6 {
  0%,10% { left:-38%; opacity:0; }
  24% { opacity:1; }
  72% { opacity:.9; }
  92%,100% { left:118%; opacity:0; }
}
body.performance-low .title-king-yellow-bearer,
body.performance-low .title-king-yellow-bearer::before,
body.performance-low .title-king-yellow-bearer::after {
  animation-play-state: running !important;
}

/* SECRET HARD PFP — absolutely no source artwork is rendered while locked.
   The API also withholds its asset URL until the reward is owned. */
.lockedSecretAvatarPreview {
  position: relative;
  display: grid !important;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: radial-gradient(circle at 50% 42%,#3b3211 0%,#111006 48%,#020202 100%) !important;
  border-color: rgba(232,202,83,.38) !important;
  box-shadow: inset 0 0 22px rgba(0,0,0,.88),0 0 16px rgba(220,184,48,.14) !important;
}
.lockedSecretAvatarPreview::before {
  content: '';
  position: absolute;
  inset: 12px 22px 18px;
  border-radius: 50% 50% 42% 42%;
  background: #000;
  opacity: .96;
}
.lockedSecretAvatarGlyph {
  position: relative;
  z-index: 2;
  color: #dcc44c;
  font: 900 31px/1 Georgia,serif;
  text-shadow: 0 0 14px rgba(220,196,76,.38);
}
.lockedSecretAvatarPreview small {
  position: relative;
  z-index: 2;
  margin-top: 34px;
  color: rgba(255,244,190,.7);
  font-size: 8px;
  letter-spacing: .05em;
  white-space: nowrap;
}



/* ===== King in Yellow live cosmetics hard-fix V7.9.6 ===== */
body.performance-low .title-king-yellow-question {
  animation: none !important; /* JS Web Animation supplies the subtle pulse. */
}
body.performance-low .title-king-yellow-bearer {
  animation-duration: 1.35s, 3.1s !important;
  animation-iteration-count: infinite, infinite !important;
  animation-play-state: running !important;
}
body.performance-low .title-king-yellow-bearer::before {
  animation-duration: 1.8s !important;
  animation-iteration-count: infinite !important;
  animation-play-state: running !important;
}
body.performance-low .title-king-yellow-bearer::after {
  animation-duration: 1.9s !important;
  animation-iteration-count: infinite !important;
  animation-play-state: running !important;
}
.lockedCosmetic .lockedSecretAvatarPreview img,
.lockedCosmetic:has(strong) .boss-avatar-king-yellow-secret img {
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
}


/* ===== King in Yellow locked-title preview fix V7.9.7 =====
   Locked boss titles should preview at full colour/animation. The lock only
   disables equipping; it must not desaturate the reward preview itself. */
.cosmeticCard.lockedCosmetic:has(.title-king-yellow-question),
.cosmeticCard.lockedCosmetic:has(.title-king-yellow-bearer) {
  filter: none !important;
}
.cosmeticCard.lockedCosmetic:has(.title-king-yellow-question) > .bossTitlePreview,
.cosmeticCard.lockedCosmetic:has(.title-king-yellow-bearer) > .bossTitlePreview {
  opacity: 1 !important;
  filter: none !important;
}
.cosmeticCard.lockedCosmetic .bossTitlePreview .title-king-yellow-question,
.cosmeticCard.lockedCosmetic .bossTitlePreview .title-king-yellow-bearer {
  opacity: 1 !important;
  filter: none;
}


/* ===== King reward locked-preview hard fix V7.9.8 =====
   These effect layers are real DOM nodes animated by requestAnimationFrame in
   app.js, so performance-low and generic locked-card CSS cannot freeze them. */
.kiyBossTitlePreview {
  opacity: 1 !important;
  filter: none !important;
}
.cosmeticCard.lockedCosmetic:has(.kiyRuntimeTitle) {
  filter: none !important;
}
.cosmeticCard.lockedCosmetic > .kiyBossTitlePreview {
  opacity: 1 !important;
  filter: none !important;
}
.kiyRuntimeTitle {
  opacity: 1 !important;
  position: relative !important;
  isolation: isolate !important;
}
.kiyRuntimeTitle::before,
.kiyRuntimeTitle::after {
  display: none !important;
  content: none !important;
}
.kiyRuntimeText {
  position: relative;
  z-index: 4;
  pointer-events: none;
}
.kiyRuntimeSigil {
  position: absolute;
  z-index: 5;
  left: .5em;
  top: 50%;
  transform-origin: 50% 50%;
  color: #ffe56e;
  text-shadow: 0 0 4px #fff7b0, 0 0 12px #e6bd25, 0 0 19px rgba(53,231,241,.78);
  pointer-events: none;
  will-change: transform, opacity;
}
.title-king-yellow-question.kiyRuntimeTitle .kiyRuntimeSigil {
  color: #ffe16a;
  text-shadow: 0 0 5px #fff3a1, 0 0 10px rgba(86,236,243,.9), 0 0 16px rgba(228,188,47,.55);
}
.kiyRuntimeSweep {
  position: absolute;
  z-index: 3;
  top: -120%;
  bottom: -120%;
  left: 0;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(61,235,244,.08), rgba(255,239,133,.94), rgba(50,229,240,.35), transparent);
  mix-blend-mode: screen;
  pointer-events: none;
  will-change: transform, opacity;
}
.title-king-yellow-question.kiyRuntimeTitle .kiyRuntimeSweep {
  background: linear-gradient(90deg, transparent, rgba(86,236,243,.08), rgba(255,239,160,.68), rgba(86,236,243,.2), transparent);
}


/* ===== Jabberwock reward titles V2 — hard animation reliability fix ===== */
.boss-title-jabberwock-easy,
.boss-title-jabberwock-legendary{
  position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  vertical-align:middle!important;white-space:nowrap!important;line-height:1.2!important;isolation:isolate!important;
  overflow:hidden!important;will-change:transform,filter,background-position,box-shadow!important;
}

/* EASY — FRABJOUS! Tulgey iridescence with a glowing Jabberwock eye. */
.boss-title-jabberwock-easy{
  padding:.25em .82em .28em 1.92em!important;border-radius:999px!important;
  border:1px solid rgba(145,242,221,.68)!important;color:#f5fff9!important;
  background:linear-gradient(110deg,#0b1718 0%,#16483f 26%,#2b1d4d 48%,#267a6a 70%,#0b1718 100%)!important;
  background-size:250% 100%!important;font-weight:950!important;letter-spacing:.055em!important;
  text-shadow:0 0 4px rgba(224,255,248,.78),0 0 11px rgba(124,236,216,.46)!important;
  box-shadow:inset 0 0 14px rgba(131,240,220,.12),0 0 10px rgba(80,220,195,.28),0 0 23px rgba(142,88,242,.24)!important;
  animation:jabberEasyBreath 2.7s ease-in-out infinite,jabberEasyFlow 6.5s linear infinite!important
}
.boss-title-jabberwock-easy::before{content:'◉';position:absolute;left:.52em;top:50%;transform:translateY(-50%);color:#c9b6ff;font-size:1.05em;text-shadow:0 0 4px #efe7ff,0 0 10px #9a6dff,0 0 17px rgba(85,245,214,.75);animation:jabberEasyEye 2s ease-in-out infinite!important}
.boss-title-jabberwock-easy::after{content:'';position:absolute;z-index:-1;top:-120%;bottom:-120%;width:24%;left:-34%;background:linear-gradient(90deg,transparent,rgba(102,241,222,.06),rgba(223,203,255,.65),rgba(91,231,213,.12),transparent);transform:skewX(-18deg);animation:jabberEasySweep 3.4s ease-in-out infinite!important}
@keyframes jabberEasyBreath{0%,100%{transform:translateY(0) scale(1);filter:brightness(.97)}50%{transform:translateY(-1px) scale(1.025);filter:brightness(1.17) saturate(1.22)}}
@keyframes jabberEasyFlow{to{background-position:250% 0}}
@keyframes jabberEasyEye{0%,100%{transform:translateY(-50%) scale(.9);opacity:.72}50%{transform:translateY(-50%) scale(1.16);opacity:1}}
@keyframes jabberEasySweep{0%,16%{left:-34%;opacity:0}32%{opacity:.58}72%{opacity:.32}100%{left:114%;opacity:0}}

/* HARD — O FRABJOUS DAY! A full prismatic Vorpal aura: rainbow plate,
   sword sigil, white-gold pulse and a fast diagonal slash across the title. */
.boss-title-jabberwock-legendary{
  padding:.31em 1.02em .33em 2.18em!important;border-radius:999px!important;
  border:1px solid rgba(255,249,215,.92)!important;color:#fffdf6!important;
  background:linear-gradient(105deg,#ff3d6e 0%,#ff8d22 14%,#ffe567 29%,#36e3b9 45%,#35c8ff 61%,#7d6cff 77%,#d74dff 90%,#ff3d6e 100%)!important;
  background-size:360% 100%!important;font-weight:1000!important;letter-spacing:.072em!important;
  text-shadow:0 0 3px #fff,0 0 8px rgba(255,247,195,.94),0 0 17px rgba(91,91,255,.65)!important;
  box-shadow:inset 0 0 20px rgba(255,255,255,.24),0 0 12px rgba(255,245,183,.72),0 0 30px rgba(109,92,255,.52),0 0 48px rgba(38,218,230,.20)!important;
  animation:jabberHardPulse 1.9s ease-in-out infinite,jabberHardPrism 6.8s linear infinite!important
}
.boss-title-jabberwock-legendary::before{content:'⚔';position:absolute;z-index:5;left:.55em;top:50%;transform:translateY(-50%) rotate(-12deg);color:#fff8cd;font-size:1.17em;text-shadow:0 0 4px #fff,0 0 11px #ffe365,0 0 20px rgba(111,85,255,.92);animation:jabberHardSword 1.25s ease-in-out infinite!important}
.boss-title-jabberwock-legendary::after{content:'';position:absolute;z-index:4;top:-130%;bottom:-130%;width:18%;left:-32%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),#fffbe1 46%,#ffffff 52%,rgba(130,245,255,.55) 58%,rgba(255,255,255,.08),transparent);mix-blend-mode:screen;transform:skewX(-19deg);filter:blur(.2px);animation:jabberHardSlash 1.55s cubic-bezier(.38,.02,.2,1) infinite!important}
@keyframes jabberHardPrism{to{background-position:360% 0}}
@keyframes jabberHardPulse{0%,100%{transform:translateY(0) scale(1);filter:brightness(1.01) saturate(1.1)}50%{transform:translateY(-1px) scale(1.045);filter:brightness(1.3) saturate(1.45) hue-rotate(10deg)}}
@keyframes jabberHardSword{0%,100%{transform:translateY(-50%) rotate(-15deg) scale(.94);opacity:.82}50%{transform:translateY(-52%) rotate(8deg) scale(1.2);opacity:1}}
@keyframes jabberHardSlash{0%,10%{left:-32%;opacity:0}22%{opacity:1}58%{opacity:.98}76%,100%{left:116%;opacity:0}}

/* Real DOM effect layers used in the cosmetics menu. They remain animated even
   when global performance CSS interferes with pseudo-element keyframes. */
.jabberBossTitlePreview{opacity:1!important;filter:none!important}.cosmeticCard.lockedCosmetic:has(.jabberRuntimeTitle){filter:none!important}.cosmeticCard.lockedCosmetic>.jabberBossTitlePreview{opacity:1!important;filter:none!important}.jabberRuntimeTitle{opacity:1!important;position:relative!important;isolation:isolate!important}.jabberRuntimeTitle::before,.jabberRuntimeTitle::after{display:none!important;content:none!important}.jabberRuntimeText{position:relative;z-index:6;pointer-events:none}.jabberRuntimeSigil{position:absolute;z-index:7;left:.55em;top:50%;transform-origin:50% 50%;pointer-events:none;will-change:transform,opacity;color:#fff8cd;text-shadow:0 0 5px #fff,0 0 12px #ffe365,0 0 20px rgba(111,85,255,.9)}.boss-title-jabberwock-easy .jabberRuntimeSigil{color:#c9b6ff;text-shadow:0 0 5px #efe7ff,0 0 11px #9a6dff,0 0 18px rgba(85,245,214,.76)}.jabberRuntimeSweep{position:absolute;z-index:5;top:-130%;bottom:-130%;left:0;width:19%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.10),#fffbe1 47%,#fff 52%,rgba(130,245,255,.48) 58%,transparent);mix-blend-mode:screen;pointer-events:none;will-change:transform,opacity}.boss-title-jabberwock-easy .jabberRuntimeSweep{background:linear-gradient(90deg,transparent,rgba(102,241,222,.04),rgba(223,203,255,.65),rgba(91,231,213,.12),transparent)}
body.performance-low .boss-title-jabberwock-easy,body.performance-low .boss-title-jabberwock-legendary,body.performance-low .boss-title-jabberwock-easy::before,body.performance-low .boss-title-jabberwock-easy::after,body.performance-low .boss-title-jabberwock-legendary::before,body.performance-low .boss-title-jabberwock-legendary::after{animation-play-state:running!important}
