:root {
  --ink: #121326;
  --muted: #5e6280;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(18, 19, 38, 0.12);
  --yellow: #ffd43b;
  --blue: #248bff;
  --red: #ff4747;
  --green: #44d62c;
  --pink: #ff4fc4;
  --violet: #8d49ff;
  --shadow: 0 18px 50px rgba(24, 27, 55, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 212, 59, 0.45), transparent 28rem),
    linear-gradient(135deg, #26a7ff 0%, #7a44ff 45%, #ff4f8b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.11) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 2px, transparent 2px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.18));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 10px 28px;
}

.hero {
  min-height: 0;
  padding: 12px;
  color: #fff;
  background:
    linear-gradient(rgba(13, 22, 48, 0.28), rgba(13, 22, 48, 0.64)),
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.16) 0 12px, transparent 12px 25px),
    linear-gradient(120deg, #00a8ff, #7d39ff 54%, #ff315d);
  border: 4px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.hero h1 {
  max-width: 8ch;
  margin: 0 0 6px;
  font-size: clamp(2.55rem, 14vw, 4.9rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.24);
}

.hero p {
  max-width: 640px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.search-box {
  display: grid;
  width: 100%;
  gap: 5px;
}

.search-box span {
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #111833;
  border: 3px solid rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  outline: none;
}

.search-box input:focus {
  border-color: var(--yellow);
}

.resource-claims {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.resource-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  min-height: 118px;
  padding: 10px 14px;
  overflow: hidden;
  color: #111833;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.18), inset 0 -7px 0 rgba(0, 0, 0, 0.12);
  text-align: left;
}

.resource-card::before {
  position: absolute;
  inset: 8px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  pointer-events: none;
}

.resource-card__shine {
  position: absolute;
  top: -42px;
  right: -28px;
  width: 110px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.resource-card img {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 4px rgba(0, 0, 0, 0.2));
}

.resource-card--gems img {
  width: 112px;
  height: 98px;
  margin-left: -14px;
}

.resource-card span:not(.resource-card__shine) {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
}

.resource-card em {
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.resource-card strong {
  font-size: clamp(1.75rem, 13vw, 3rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.5);
}

.resource-card--gems {
  background:
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.22) 0 10px, transparent 10px 22px),
    linear-gradient(135deg, #8effdf, #ffec63 50%, #ff7bd6);
}

.resource-card--coins {
  background:
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.2) 0 10px, transparent 10px 22px),
    linear-gradient(135deg, #fff26b, #ffb22e 52%, #ff6a2a);
}

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

.resource-card:active {
  transform: translateY(4px);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.rarity-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px -10px 12px;
  padding: 10px;
  overflow: hidden;
  background: rgba(15, 17, 42, 0.72);
  backdrop-filter: blur(14px);
}

.rarity-tab {
  min-width: 0;
  min-height: 38px;
  padding: 0 6px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: normal;
  overflow: hidden;
}

.rarity-tab.is-active {
  color: #121326;
  background: var(--yellow);
  border-color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.24);
}

.rarity-tab--rare { background: #3acb2a; }
.rarity-tab--super { background: #3088f4; }
.rarity-tab--epic { background: #a631e6; }
.rarity-tab--mythic { background: #e24444; }
.rarity-tab--legendary { background: #f1bf1c; color: #1d1730; }
.rarity-tab--ultra { background: linear-gradient(120deg, #5610b0, #74ff77, #fff26b); color: #1d1730; }
.rarity-tab--limited { background: #32139b; }

.gallery {
  display: grid;
  gap: 14px;
}

.rarity-section {
  display: grid;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.section-title h2 {
  margin: 0;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.section-title span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.brawler-card {
  min-width: 0;
  padding: 12px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.15);
}

.brawler-card__head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.avatar-button {
  position: relative;
  width: 72px;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid #111833;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffd43b, #ff8c2a);
  overflow: hidden;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.16);
}

.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brawler-meta {
  min-width: 0;
}

.brawler-meta h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1;
  text-transform: uppercase;
}

.brawler-meta p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.skin-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 108px;
  gap: 10px;
  max-width: 100%;
  margin: 12px -12px -2px;
  padding: 2px 12px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.skin-rail::-webkit-scrollbar {
  display: none;
}

.skin-card {
  display: grid;
  gap: 7px;
  min-height: 142px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  scroll-snap-align: start;
}

.skin-card__art {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #111833;
  border-radius: 8px;
  background: linear-gradient(145deg, #eef6ff, #ffdfe9);
  object-fit: contain;
}

.skin-card strong {
  color: #252946;
  font-size: 0.78rem;
  line-height: 1.1;
}

.skin-card--default {
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 2px rgba(255, 212, 59, 0.4);
}

.empty-state {
  padding: 28px 18px;
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state h2 {
  margin: 0 0 8px;
  text-transform: uppercase;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.load-more-sentinel {
  width: 100%;
  height: 1px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  overflow: hidden;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(10, 12, 28, 0.66);
}

.modal__sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 20px);
  max-width: 620px;
  max-height: calc(100dvh - 20px);
  margin: 0 auto;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.22), transparent 210px),
    #fff;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #111833;
  font-weight: 900;
}

.modal__art-wrap {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 3px solid #111833;
  border-radius: 8px;
  background:
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.35) 0 12px, transparent 12px 24px),
    linear-gradient(145deg, #23a8ff, #ff4f8b);
}

.modal__art {
  width: min(74vw, 330px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 18px 12px rgba(0, 0, 0, 0.25));
}

.resource-modal__sheet {
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.26), transparent 230px),
    #fff;
}

.resource-modal__art-wrap {
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 3px solid #111833;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.85) 0 18%, transparent 19%),
    repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.3) 0 12px, transparent 12px 24px),
    linear-gradient(145deg, #29c4ff, #ffe45e 48%, #ff5ea8);
}

.resource-modal__art {
  width: min(70vw, 280px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 20px 10px rgba(0, 0, 0, 0.22));
}

.resource-modal__body h2 {
  font-size: clamp(2rem, 13vw, 3.2rem);
}

.modal__body {
  padding-top: 14px;
}

.modal__rarity {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: #111833;
  border-radius: 8px;
  background: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal h2 {
  margin: 10px 0 6px;
  font-size: clamp(1.55rem, 9vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.modal p:empty {
  display: none;
}

.bonus-intro {
  display: grid;
  gap: 4px;
  margin: 14px 0 10px;
  padding: 10px;
  border: 2px solid rgba(255, 212, 59, 0.8);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 236, 126, 0.7), rgba(255, 255, 255, 0.92));
}

.bonus-intro strong {
  color: #111833;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bonus-intro span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.reward-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 16px;
}

.reward {
  display: grid;
  place-items: center;
  min-height: 104px;
  gap: 5px;
  padding: 8px 4px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.reward__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #111833;
  font-weight: 900;
}

.reward__icon--image {
  overflow: hidden;
}

.reward__icon--image img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.reward--charge .reward__icon--image img {
  width: 58px;
  height: 58px;
}

.reward--coins .reward__icon--image img {
  width: 52px;
  height: 52px;
}

.reward--gems .reward__icon--image img {
  width: 46px;
  height: 46px;
}

.reward--coins .reward__icon,
.reward--gems .reward__icon {
  font-size: 1.35rem;
}

.reward strong {
  font-size: 0.74rem;
}

.reward em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.claim-id-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.claim-id-field span {
  color: #111833;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.claim-id-field__control {
  position: relative;
  display: block;
}

.claim-id-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 56px 0 14px;
  color: #111833;
  border: 3px solid rgba(17, 24, 51, 0.78);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  font-weight: 900;
  outline: none;
}

.claim-id-field input:focus {
  border-color: var(--yellow);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(255, 212, 59, 0.32);
}

.paste-id-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 36px;
  color: #111833;
  border: 2px solid rgba(17, 24, 51, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff7a8, #ffd43b);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  transform: translateY(-50%);
}

.paste-id-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.paste-id-button:active {
  transform: translateY(calc(-50% + 2px));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.claim-button {
  width: 100%;
  min-height: 54px;
  color: #111833;
  border: 3px solid #111833;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffe766, #ffb22e);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.14), 0 8px 0 rgba(0, 0, 0, 0.18);
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.claim-button:disabled {
  cursor: not-allowed;
  color: rgba(17, 24, 51, 0.52);
  background: linear-gradient(180deg, #d9dce8, #aeb4c8);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08), 0 5px 0 rgba(0, 0, 0, 0.16);
}

.claim-status {
  min-height: 24px;
  padding-top: 12px;
  text-align: center;
}

@media (min-width: 680px) {
  .app-shell {
    padding: 22px;
  }

  .hero {
    min-height: 220px;
    padding: 28px;
  }

  .hero h1 {
    margin-top: 16px;
    font-size: clamp(2.75rem, 12vw, 7rem);
  }

  .hero p {
    margin-bottom: 20px;
    font-size: 1.14rem;
    line-height: 1.5;
  }

  .search-box input {
    min-height: 48px;
    padding: 0 14px;
  }

  .resource-claims {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
  }

  .resource-card {
    grid-template-columns: 112px 1fr;
    min-height: 132px;
    padding: 12px 18px;
  }

  .resource-card img {
    width: 104px;
    height: 104px;
  }

  .resource-card--gems img {
    width: 136px;
    height: 118px;
    margin-left: -18px;
  }

  .rarity-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
    margin: 12px 0 16px;
    border-radius: 8px;
  }

  .rarity-tab {
    min-height: 48px;
    padding: 0 8px;
    font-size: 0.88rem;
  }

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

  .modal__sheet {
    left: 50%;
    width: min(620px, calc(100% - 32px));
    padding: 16px;
    border-radius: 8px;
  }

  .modal__close {
    top: 12px;
    right: 12px;
  }

  .modal__art-wrap {
    min-height: 230px;
  }

  .modal__art {
    max-height: 300px;
  }
}

@media (min-width: 1020px) {
  .rarity-tabs {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .rarity-tab {
    white-space: nowrap;
  }

  .brawler-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
