:root {
  --community-bg: #061021;
  --community-panel: #0d2748;
  --community-panel-2: #123b79;
  --community-line: rgba(255, 255, 255, 0.15);
  --community-text: #fff;
  --community-muted: #b7d0f7;
  --community-blue: #2478f3;
  --community-gold: #ffc400;
  --community-green: #12bd72;
  --community-outline: #020711;
}

* { box-sizing: border-box; }

.community-page {
  min-height: 100vh;
  margin: 0;
  color: var(--community-text);
  font-family: "Lilita One", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(36, 120, 243, 0.25), transparent 28rem),
    radial-gradient(circle at 84% 38%, rgba(255, 196, 0, 0.12), transparent 24rem),
    var(--community-bg);
}

.community-page button,
.community-page input,
.community-page select { font: inherit; }

.community-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.community-hero,
.vote-browser,
.active-poll {
  border: 1px solid var(--community-line);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.25);
}

.community-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: 320px;
  padding: clamp(30px, 4vw, 50px);
  border-radius: 22px;
  background:
    linear-gradient(110deg, rgba(4, 25, 51, 0.98) 25%, rgba(10, 74, 159, 0.78)),
    url("/assets/websitebg.png") center / cover;
}

.community-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 380px;
  height: 380px;
  border: 70px solid rgba(255, 196, 0, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.community-hero-copy,
.community-metrics { position: relative; z-index: 1; }

.community-eyebrow {
  margin: 0 0 8px;
  color: var(--community-gold);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.community-hero h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 0.96;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.5);
}

.community-hero-copy > p:not(.community-eyebrow) {
  max-width: 670px;
  margin: 16px 0 0;
  color: var(--community-muted);
  font: 600 17px/1.55 "Segoe UI", Arial, sans-serif;
}

.hero-vote-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px 18px;
  border: 3px solid var(--community-outline);
  border-radius: 12px;
  color: #241600;
  background: linear-gradient(180deg, #ffe568, var(--community-gold));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.55), 0 4px 0 #7b4b00;
  text-decoration: none;
}

.community-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-self: center;
}

.community-metrics div {
  min-width: 0;
  padding: 22px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  background: rgba(2, 16, 35, 0.72);
  text-align: center;
}

.community-metrics strong { display: block; color: var(--community-gold); font-size: 30px; }
.community-metrics span { display: block; margin-top: 3px; color: var(--community-muted); font: 700 11px/1.1 "Segoe UI", Arial, sans-serif; }

.vote-browser,
.active-poll {
  margin-top: 22px;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 47, 91, 0.96), rgba(5, 23, 47, 0.96));
}

.vote-browser-head,
.poll-heading {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.vote-browser h2,
.poll-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1; }

.vote-tools { display: flex; gap: 10px; }
.vote-tools input,
.vote-tools select {
  width: 220px;
  min-height: 46px;
  padding: 0 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 11px;
  color: #fff;
  background: rgba(3, 18, 39, 0.88);
  outline: none;
}
.vote-tools input:focus,
.vote-tools select:focus { border-color: var(--community-gold); }

.brawler-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 330px;
  margin-top: 20px;
  padding: 3px 4px 8px;
  overflow-y: auto;
}

.brawler-chip {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px;
  border: 2px solid rgba(255,255,255,0.14);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, #1c477f, #102b50);
  cursor: pointer;
  text-align: left;
}

.brawler-chip:hover,
.brawler-chip.active {
  border-color: var(--community-gold);
  background: linear-gradient(180deg, #2e79d8, #1751a3);
  transform: translateY(-1px);
}

.brawler-chip img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.5));
}

.brawler-chip > span:not(.brawler-voted-mark) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.brawler-chip small { display: block; margin-top: 3px; color: var(--community-muted); font: 700 10px "Segoe UI", Arial, sans-serif; }
.brawler-chip.voted { padding-right: 34px; }
.brawler-voted-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 2px solid rgba(255,255,255,0.45);
  border-radius: 50%;
  color: #062215;
  background: #52e798;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
  font: 900 12px/1 "Segoe UI", Arial, sans-serif;
}

.poll-heading { justify-content: flex-start; }
.poll-brawler-avatar {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 3px solid var(--community-outline);
  border-radius: 18px;
  background: linear-gradient(180deg, #3e91f7, #1855ad);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.25), 0 5px 0 rgba(0,0,0,0.45);
}
.poll-brawler-avatar img { width: 78px; height: 78px; object-fit: contain; }
.poll-heading > div:nth-child(2) { flex: 1; }
.poll-heading > div:nth-child(2) > p:last-child { margin: 8px 0 0; color: var(--community-muted); font: 600 14px "Segoe UI", Arial, sans-serif; }
.poll-total {
  min-width: 100px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #241600;
  background: var(--community-gold);
  text-align: center;
}
.poll-total strong { display: block; font-size: 26px; }
.poll-total span { font-size: 11px; text-transform: uppercase; }

.poll-notice {
  margin: 22px 0 16px;
  padding: 12px 15px;
  border-left: 4px solid var(--community-gold);
  border-radius: 8px;
  color: var(--community-muted);
  background: rgba(0,0,0,0.2);
  font: 700 13px/1.4 "Segoe UI", Arial, sans-serif;
}
.poll-notice.success { border-left-color: var(--community-green); color: #c9ffe5; }
.poll-notice.error { border-left-color: #ff587d; color: #ffd2dc; }

.skin-vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 13px;
}

.poll-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.next-brawler-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border: 3px solid var(--community-outline);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, #368df6, #1760c7);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), 0 4px 0 #061328;
  cursor: pointer;
}
.next-brawler-button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.skin-vote-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 180px auto;
  border: 2px solid rgba(255,255,255,0.13);
  border-radius: 14px;
  background: linear-gradient(180deg, #163e73, #0b2445);
  box-shadow: 0 5px 0 rgba(0,0,0,0.36);
}
.skin-vote-card.selected { border-color: var(--community-green); box-shadow: 0 0 0 2px rgba(18,189,114,0.24), 0 5px 0 rgba(0,0,0,0.36); }
.skin-vote-art {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px;
  background: radial-gradient(circle, rgba(65,145,255,0.45), rgba(4,19,42,0.25) 65%);
}
.skin-vote-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 5px rgba(0,0,0,0.45));
}
.rarity-pill { position: absolute; top: 9px; left: 9px; z-index: 2; padding: 5px 8px; border-radius: 999px; color: #fff; background: rgba(1,9,21,0.78); font: 800 10px "Segoe UI", Arial, sans-serif; }
.skin-vote-body { position: relative; z-index: 2; min-width: 0; display: grid; gap: 9px; padding: 12px; background: linear-gradient(180deg, #123763, #0b2445); }
.skin-vote-body h3 { min-height: 40px; margin: 0; font-size: 18px; line-height: 1.08; }
.skin-vote-button {
  width: 100%;
  min-height: 42px;
  border: 3px solid var(--community-outline);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(180deg, #3187f4, #1557bd);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.2), 0 3px 0 #030a15;
  cursor: pointer;
}
.skin-vote-button:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.skin-vote-button:disabled { cursor: default; opacity: 0.62; }
.skin-vote-card.selected .skin-vote-button { background: linear-gradient(180deg, #23cf82, #078e50); opacity: 1; }
.vote-result { display: none; gap: 7px; }
.results-visible .vote-result { display: grid; }
.vote-result-row { display: flex; justify-content: space-between; color: var(--community-muted); font: 800 12px "Segoe UI", Arial, sans-serif; }
.vote-result-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(0,0,0,0.35); }
.vote-result-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--community-blue), var(--community-gold)); transition: width 0.35s ease; }

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

@media (max-width: 820px) {
  .community-hero { grid-template-columns: 1fr; min-height: 0; }
  .vote-browser-head { align-items: stretch; flex-direction: column; }
  .vote-tools input,
  .vote-tools select { width: 100%; }
  .vote-tools > label { flex: 1; }
}

@media (max-width: 600px) {
  .community-shell { width: min(100% - 16px, 1180px); padding-top: 18px; }
  .community-hero { gap: 22px; padding: 25px 19px; border-radius: 15px; }
  .community-hero h1 { font-size: 43px; }
  .community-hero-copy > p:not(.community-eyebrow) { font-size: 14px; }
  .community-metrics strong { font-size: 23px; }
  .community-metrics span { font-size: 9px; }
  .vote-browser,
  .active-poll { padding: 16px 12px; border-radius: 13px; }
  .vote-tools { flex-direction: column; }
  .brawler-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 290px; }
  .poll-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .poll-brawler-avatar { flex-basis: 68px; width: 68px; height: 68px; border-radius: 13px; }
  .poll-brawler-avatar img { width: 60px; height: 60px; }
  .poll-heading > div:nth-child(2) { min-width: calc(100% - 82px); }
  .poll-total { width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
  .skin-vote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .skin-vote-card { grid-template-rows: 140px auto; border-radius: 11px; }
  .skin-vote-body { padding: 9px; }
  .skin-vote-body h3 { min-height: 34px; font-size: 15px; }
  .skin-vote-button { min-height: 38px; font-size: 13px; }
}

@media (max-width: 370px) {
  .skin-vote-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
