.twitch-card-experience {
  --twitch-card-reward-gold: #ffd76a;
  --twitch-card-reward-cyan: #65e8ff;
  --twitch-card-filter-accent: #65e8ff;
  --twitch-card-filter-active: #9147ff;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.twitch-card-experience__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.twitch-card-experience__head p { margin: 0; color: #bf94ff; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.13em; }
.twitch-card-experience__head h3 { margin: 1px 0 0; font-size: 1rem; }
.twitch-card-experience__head button { width: 30px; height: 30px; border: 1px solid #ffffff24; border-radius: 9px; color: #fff; background: #ffffff0b; }
.twitch-card-experience__preview { display: grid; min-height: 80px; place-items: center; }
.twitch-card-experience.is-editor .twitch-card-experience__preview .twitch-participant-card {
  margin-block: calc(18px + var(--twitch-card-frame-safe-y, 0px));
}
.twitch-card-experience__scope,
.twitch-card-experience__hint,
.twitch-card-experience__freshness,
.twitch-card-experience__status { margin: 0; color: #adadb8; font-size: 0.7rem; text-align: center; }
.twitch-card-experience__freshness:empty { display: none; }
.twitch-card-experience__identity { padding: 12px; border: 1px solid #9147ff55; border-radius: 12px; background: #9147ff14; text-align: center; }
.twitch-card-experience__identity p { margin: 0 0 9px; font-size: 0.76rem; }
.twitch-card-experience button { cursor: pointer; }
.twitch-card-experience button:disabled { cursor: not-allowed; opacity: 0.48; }
.twitch-card-experience__identity button,
.twitch-card-experience__show,
.twitch-card-editor__item button { padding: 8px 10px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(120deg, #9147ff, #6d28d9); font: inherit; font-weight: 800; }
.twitch-card-experience__show { width: 100%; min-height: 38px; }
.twitch-card-experience__show--appearance { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.twitch-card-experience__appearance-xp {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #fff1a966;
  border-radius: 999px;
  color: #10131a;
  background: linear-gradient(120deg, var(--twitch-card-reward-gold), var(--twitch-card-reward-cyan));
  box-shadow: 0 0 12px #65e8ff55, inset 0 1px 0 #fff9;
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 #fff8;
  white-space: nowrap;
}
.twitch-card-experience__xp-reward {
  position: relative;
  justify-self: center;
  margin: -2px 0 0;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid #ffd76a88;
  border-radius: 999px;
  color: #fffbd8;
  background: linear-gradient(110deg, #261c06f2, #063444f2);
  box-shadow: 0 0 0 1px #65e8ff24, 0 6px 18px #0008, 0 0 18px #65e8ff38;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-align: center;
  animation: twitchCardAppearanceReward 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.twitch-card-experience__xp-reward > span { margin-right: 5px; color: var(--twitch-card-reward-gold); }
.twitch-card-experience__xp-reward::after {
  position: absolute;
  inset: -50% auto -50% -35%;
  width: 28%;
  background: linear-gradient(90deg, transparent, #fff9, transparent);
  content: "";
  transform: rotate(18deg);
  animation: twitchCardAppearanceRewardShine 1.1s 0.12s ease-out both;
}
.twitch-card-experience__error { margin: 0; padding: 7px 9px; border: 1px solid #ef444455; border-radius: 9px; color: #fecaca; background: #ef444417; font-size: 0.71rem; }
.twitch-card-editor__group { min-width: 0; padding: 10px; border: 1px solid #ffffff17; border-radius: 13px; background: #ffffff08; }
.twitch-card-editor__tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 6px; padding: 5px; border: 1px solid #ffffff17; border-radius: 12px; background: #070b12cc; }
.twitch-card-editor__tabs button { min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; color: #adadb8; background: transparent; font: inherit; font-size: 0.68rem; font-weight: 850; }
.twitch-card-editor__tabs button.is-active { border-color: #a970ff66; color: #fff; background: linear-gradient(120deg, #9147ff, #6d28d9); box-shadow: 0 4px 12px #6d28d944; }
.twitch-card-editor__catalog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 8px; }
.twitch-card-editor__group h4,
.twitch-card-editor__group legend { margin: 0 0 8px; color: #f7f7f8; font-size: 0.82rem; font-weight: 850; }
.twitch-card-editor__catalog-head h4 { margin: 0; }
.twitch-card-editor__ownership-filter {
  display: grid;
  flex: 0 1 184px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  min-width: min(100%, 150px);
  padding: 2px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  background: #070b12d9;
  box-shadow: inset 0 1px 0 #ffffff0a;
}
.twitch-card-editor__ownership-filter button {
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #b9bac3;
  background: transparent;
  font: inherit;
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.twitch-card-editor__ownership-filter button.is-active {
  border-color: color-mix(in srgb, var(--twitch-card-filter-accent) 45%, transparent);
  color: #fff;
  background: linear-gradient(120deg, var(--twitch-card-filter-active), #5332a8);
  box-shadow: 0 0 0 1px #ffffff0d, 0 3px 10px #5b21b655;
}
.twitch-card-editor__ownership-filter button:focus-visible {
  outline: 2px solid var(--twitch-card-filter-accent);
  outline-offset: 2px;
}
.twitch-card-editor__catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 8px; }
.twitch-card-editor__item { position: relative; display: grid; min-width: 0; gap: 4px; align-content: start; padding: 7px; border: 1px solid #ffffff18; border-radius: 10px; color: #efeff1; background: #0e0e10b8; text-align: left; }
.twitch-card-editor__item.is-equipped { border-color: #a970ff; box-shadow: inset 0 0 0 1px #a970ff55; }
.twitch-card-editor__item.is-previewing { border-color: #7ee7ff; box-shadow: inset 0 0 0 1px #7ee7ff88, 0 0 12px #7ee7ff24; }
.twitch-card-editor__preview-hitbox { position: absolute; inset: 0; z-index: 0; width: 100%; padding: 0 !important; border: 0 !important; border-radius: inherit !important; background: transparent !important; box-shadow: none !important; cursor: zoom-in; }
.twitch-card-editor__preview-hitbox:focus-visible { outline: 2px solid #7ee7ff; outline-offset: 2px; }
.twitch-card-editor__item > :not(.twitch-card-editor__preview-hitbox) { position: relative; z-index: 1; pointer-events: none; }
.twitch-card-editor__item > button:not(.twitch-card-editor__preview-hitbox) { z-index: 2; pointer-events: auto; }
.twitch-card-editor__item > .twitch-card-editor__purchase-xp {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 4px 7px;
  border: 1px solid #f5d76e99;
  border-radius: 999px;
  color: #fff7bf;
  background: #251d05e8;
  box-shadow: 0 3px 10px #0009;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
}
.twitch-card-editor__thumb { width: 100%; height: 46px; border-radius: 7px; background: #29292e; object-fit: contain; }
.twitch-card-editor__thumb.is-base { display: grid; color: #bf94ff; font-weight: 900; place-items: center; }
.twitch-card-editor__item--experience_bar { grid-column: span 2; }
.twitch-card-editor__xp-preview { display: grid; grid-template-columns: 41px minmax(0, 1fr); align-items: center; gap: 6px; height: 78px; padding: 6px 8px; overflow: hidden; background: radial-gradient(circle at 18% 12%, #ffffff1f, transparent 34%), linear-gradient(135deg, #081522, #10273b); }
.twitch-card-editor__xp-level { position: relative; isolation: isolate; display: grid; width: 38px; height: 47px; place-items: center; filter: drop-shadow(0 4px 4px #0009); }
.twitch-card-editor__xp-level > img { position: absolute; inset: -4px -3px; z-index: 0; width: calc(100% + 6px); height: calc(100% + 8px); object-fit: fill; }
.twitch-card-editor__xp-level > span { position: relative; z-index: 1; display: grid; color: #fff; line-height: 1; text-align: center; text-shadow: 0 1px 2px #000, 0 0 5px #000; }
.twitch-card-editor__xp-level small { color: inherit; font-size: 0.38rem; font-weight: 850; text-transform: uppercase; }
.twitch-card-editor__xp-level strong { margin-top: 2px; font-size: 0.72rem; }
.twitch-card-editor__xp-bar { display: grid; min-width: 0; height: 60px; place-items: center; }
.twitch-card-editor__xp-track { position: relative; isolation: isolate; width: 80%; height: 18px; border-radius: 999px; background: linear-gradient(180deg, #02050b, #0b1724); box-shadow: inset 0 1px 4px #000, 0 4px 8px #0007; }
.twitch-card-editor__xp-fill { position: absolute; inset: 1px auto 1px 1px; z-index: 1; width: 74%; border-radius: inherit; background-image: var(--twitch-xp-preview-fill, linear-gradient(90deg, #9147ff, #32d7ff)); background-position: 0 0; background-size: 104px 100%; background-repeat: repeat-x; filter: saturate(1.2) brightness(1.08); animation: twitchCardXpPreviewFlow 2.4s linear infinite; }
.twitch-card-editor__xp-glow { position: absolute; inset: 1px 26% 1px 1px; z-index: 2; border-radius: inherit; background: linear-gradient(90deg, #ffffff30, transparent 70%); animation: twitchCardXpPreviewGlow 1.8s ease-in-out infinite; }
.twitch-card-editor__xp-frame { position: absolute; top: 50%; left: 50%; z-index: 3; width: 120%; height: 60px; object-fit: fill; transform: translate(-50%, -50%); }
.twitch-card-editor__xp-copy { position: absolute; inset: 0; z-index: 4; display: grid; color: #fff; font-size: 0.4rem; font-weight: 900; line-height: 1; text-align: center; text-shadow: 0 1px 2px #000, 0 0 5px #000; place-items: center; }
.twitch-card-editor__thumb--frame { display: block; position: relative; overflow: hidden; }
.twitch-card-editor__frame-scale { position: absolute; top: 50%; left: 50%; width: 200px; height: 300px; transform: translate(-50%, -50%) scale(0.13); transform-origin: center; }
.twitch-card-editor__frame-backdrop,
.twitch-card-editor__frame-asset { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.twitch-card-editor__frame-backdrop { z-index: 0; }
.twitch-card-editor__frame-asset { z-index: 1; }
.twitch-card-editor__frame-swatch {
  --bg-1: var(--er-bg-1, #0c2a52);
  --bg-2: var(--er-bg-3, #1f5fa7);
  --bg-3: #58b9e3;
  --wood-1: #765838;
  --wood-2: #b9834d;
  --paper-1: var(--er-paper, #fff6ea);
  --paper-2: #e8f3ff;
  --paper-3: var(--er-muted, #c7d9ea);
  --ink: var(--er-ink, #06121f);
  display: block;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 18px;
}
.twitch-card-editor__frame-swatch-card {
  position: absolute;
  inset: 22px 16px;
  z-index: 4;
  border: 1px solid #ffffff42;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 25%, #ffffff2b 0 14%, transparent 15%),
    linear-gradient(160deg, #07111ccc, #16263bd9);
  box-shadow: 0 8px 18px #0008, inset 0 0 16px #ffffff0c;
}
.twitch-card-editor__item b { overflow: hidden; font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.twitch-card-editor__item small { color: #adadb8; font-size: 0.61rem; }
.twitch-card-editor__item button { padding: 6px; font-size: 0.62rem; }
.twitch-card-editor__loading { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.twitch-card-editor__spinner { width: 0.75em; height: 0.75em; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: twitchCardEquipmentSpin 0.65s linear infinite; }
.twitch-card-experience .twitch-card-editor__item button.is-saving:disabled,
.twitch-card-experience .twitch-card-editor__item.is-saving:disabled { opacity: 0.82; }
@keyframes twitchCardEquipmentSpin { to { transform: rotate(360deg); } }
@keyframes twitchCardXpPreviewFlow { to { background-position: -104px 0; } }
@keyframes twitchCardXpPreviewGlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }
@keyframes twitchCardAppearanceReward {
  0% { opacity: 0; transform: translateY(7px) scale(0.88); }
  18%, 76% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-5px) scale(0.96); }
}
@keyframes twitchCardAppearanceRewardShine {
  from { left: -35%; opacity: 0; }
  30% { opacity: 0.85; }
  to { left: 115%; opacity: 0; }
}
.twitch-card-editor__locked { color: #adadb8; font-size: 0.58rem; }
.twitch-card-editor__empty { grid-column: 1 / -1; color: #adadb8; font-size: 0.7rem; }
.twitch-card-editor__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.twitch-card-editor__badges legend { width: 100%; }
.twitch-card-editor__badges label { display: flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid #ffffff17; border-radius: 999px; font-size: 0.65rem; }
.twitch-card-editor__badges input { accent-color: #9147ff; }
.twitch-card-editor__badge-icon { display: inline-grid; min-width: 1.2em; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-size: 1rem; line-height: 1; place-items: center; }
.twitch-card-experience__cosmetic-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 1px solid #7ee7ff55; border-radius: 10px; color: #dff9ff; background: #7ee7ff12; font-size: 0.67rem; }
.twitch-card-experience__cosmetic-preview button { flex: 0 0 auto; padding: 5px 7px; border: 1px solid #7ee7ff44; border-radius: 8px; color: #fff; background: #7ee7ff18; font: inherit; font-weight: 800; }
.twitch-card-experience.is-compact { gap: 7px; }
.twitch-card-experience.is-compact .twitch-card-experience__head h3 { font-size: 0.8rem; }
.twitch-card-experience.is-compact .twitch-card-experience__scope { display: none; }
.twitch-card-experience.is-compact .twitch-card-experience__show { min-height: 30px; padding: 6px; font-size: 0.67rem; }
.twitch-card-experience.is-compact .twitch-card-experience__appearance-xp { padding: 3px 5px; font-size: 0.52rem; }
.twitch-card-experience.is-compact .twitch-card-editor__ownership-filter { flex-basis: 160px; }
.twitch-card-experience.is-compact .twitch-card-editor__ownership-filter button { min-height: 23px; padding-inline: 5px; font-size: 0.55rem; }

@media (orientation: landscape) and (max-height: 520px) {
  .twitch-card-experience.is-editor { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
  .twitch-card-experience.is-editor .twitch-card-experience__head,
  .twitch-card-experience.is-editor .twitch-card-experience__preview,
  .twitch-card-experience.is-editor .twitch-card-experience__scope,
  .twitch-card-experience.is-editor .twitch-card-experience__show,
  .twitch-card-experience.is-editor .twitch-card-experience__xp-reward,
  .twitch-card-experience.is-editor .twitch-card-experience__hint,
  .twitch-card-experience.is-editor .twitch-card-experience__freshness { grid-column: 1; }
  .twitch-card-experience.is-editor .twitch-card-editor__group { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .twitch-card-editor__xp-fill,
  .twitch-card-editor__xp-glow,
  .twitch-card-experience__xp-reward,
  .twitch-card-experience__xp-reward::after { animation: none; }
}
