:root {
  --ink: #f3e9ff;
  --paper: #07060b;
  --paper-2: #120c1c;
  --seal: #b57bff;
  --gold: #d2a8ff;
  --muted: #9b8fb3;
  --line: rgba(181, 123, 255, 0.22);
  --card: #120c1c;
  --display: "Sora", sans-serif;
  --body: "Sora", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--body);
  color: var(--ink);
  padding-bottom: 88px;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(123, 47, 247, 0.28) 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(88, 28, 160, 0.35) 0%, transparent 50%),
    var(--paper);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.top,
main,
footer,
.nav {
  position: relative;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 8px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.seal {
  width: 52px;
  height: 52px;
  border: 2px solid var(--seal);
  color: var(--seal);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
}

.kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
}

h1 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.join-btn {
  margin: 0;
  border: 1px solid var(--seal);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  background: #1a0f2c;
  white-space: nowrap;
}

.join-btn:hover {
  color: var(--seal);
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  padding: 4px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--seal) transparent;
}

.nav::-webkit-scrollbar {
  height: 4px;
}

.nav::-webkit-scrollbar-thumb {
  background: var(--seal);
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid transparent;
  flex: 0 0 auto;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  border-bottom-color: var(--seal);
  color: var(--seal);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding-bottom: 48px;
}

.waifu-card {
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: block;
}

.waifu-card a {
  color: inherit;
  text-decoration: none;
}

.waifu-card.is-favorite,
.waifu-card.is-current {
  border-color: var(--seal);
}

.waifu-card.is-wish {
  border-color: #6e6a78;
}

.waifu-card.is-wish img {
  filter: grayscale(1);
  opacity: 0.72;
}

.fav-btn {
  font: inherit;
  color: var(--ink);
  background: #1a0f2c;
  border: 1px solid var(--seal);
  margin: 0 12px 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.waifu-card img,
.hero-art img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--paper-2);
}

.waifu-card img.pixel,
.hero-art img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.waifu-card .meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.waifu-card .chip {
  width: fit-content;
}

.waifu-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.waifu-card .energy {
  color: var(--seal);
  font-size: 12px;
  font-weight: 600;
}

.waifu-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
}

.filters input,
.filters select,
.filters button,
.pager a,
.pager button {
  background: #0c0914;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
}

.filters button,
.pager a,
.pager button {
  cursor: pointer;
  text-decoration: none;
}

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 40px;
}

.hero-art {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 24px;
  padding: 24px 0 48px;
}

.chip.comum { color: #cfc6dd; }
.chip.rara { color: #8ec8ff; border-color: #8ec8ff; }
.chip.epica { color: #c9a6ff; border-color: #c9a6ff; }
.chip.lendaria { color: #ffd27a; border-color: #ffd27a; }
.chip.mitica { color: #fff; background: #7a3dff; border-color: #7a3dff; }

.hero {
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--line);
}

.prestige {
  max-width: 420px;
  margin: 16px 0 8px;
}

.prestige-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.prestige-track {
  height: 12px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(181, 123, 255, 0.16);
}

.prestige-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a3dff, #d2a8ff);
}

.prestige-need {
  margin: 2px 0 0;
  color: var(--seal);
  font-size: 13px;
}

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

h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h3 {
  font-family: var(--display);
}

.lede {
  max-width: 62ch;
  color: #d8ccee;
  line-height: 1.55;
}

.perk-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 8px;
  max-width: 62ch;
}

.perk-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  line-height: 1.45;
}

.proof {
  display: grid;
  gap: 16px;
  margin: 20px 0 8px;
}

.proof figure {
  margin: 0;
}

.proof img {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.proof figcaption {
  margin-top: 8px;
  color: #d8ccee;
  font-size: 14px;
}

@media (min-width: 760px) {
  .proof {
    grid-template-columns: repeat(2, minmax(0, 420px));
  }
}

.event-description {
  white-space: pre-line;
}

.command-hint {
  background: #140c22;
  border-left: 3px solid var(--seal);
  padding: 12px 14px;
  color: #e6d9ff;
}

.command-hint label,
.rsvp {
  display: block;
  margin: 12px 0;
}

.command-hint input,
.command-hint textarea,
.command-hint button,
.rsvp button,
#logout,
#create {
  font: inherit;
  color: var(--ink);
  background: #1a0f2c;
  border: 1px solid var(--seal);
  padding: 10px 12px;
}

.command-hint input,
.command-hint textarea {
  display: block;
  width: min(100%, 420px);
  margin-top: 6px;
}

.ads-form-error {
  color: #ffb4c8;
  min-height: 1.2em;
}

.rsvp {
  display: flex;
  gap: 8px;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.admin-cards article,
.admin-block {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin: 14px 0;
}

.admin-cards p {
  margin: 0;
  color: var(--muted);
}

.admin-cards strong {
  font-size: 32px;
}

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

.admin-tabs button,
.admin-block select,
#day {
  font: inherit;
  color: var(--ink);
  background: #1a0f2c;
  border: 1px solid var(--seal);
  padding: 8px 12px;
}

.admin-tabs button.active {
  background: var(--seal);
  color: #140c22;
}

.quickban-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.chart {
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 0;
  list-style: none;
}

.legend-list i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: rgba(181, 123, 255, 0.14);
  padding: 1px 6px;
}

.legend {
  display: flex;
  gap: 10px;
  padding: 18px 0;
}

.chip {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
}

.chip.gravissimo {
  color: #fff;
  background: #7a3dff;
  border-color: #7a3dff;
}

.chip.grave {
  color: var(--seal);
}

.chip.medio {
  color: #cbb6ff;
}

.list {
  display: grid;
  gap: 14px;
  padding-bottom: 64px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px 16px;
}

.num {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: var(--seal);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: #d8ccee;
  line-height: 1.5;
}

.card .details {
  grid-column: 2 / 3;
  color: var(--muted);
  font-size: 14px;
}

.severity {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  height: fit-content;
}

footer {
  padding: 0 0 40px;
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: inherit;
}

.rank-board {
  padding: 28px 0 8px;
}

.rank-board h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.rank-list {
  display: grid;
  gap: 8px;
  padding: 12px 0 24px;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.rank-row:hover {
  border-color: var(--seal);
}

.rank-place {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--muted);
}

.rank-row.podium-1 .rank-place { color: #ffd27a; }
.rank-row.podium-2 .rank-place { color: #d8ccee; }
.rank-row.podium-3 .rank-place { color: #c48a5a; }

.rank-name {
  font-weight: 600;
}

.rank-value {
  color: var(--seal);
  font-weight: 600;
  white-space: nowrap;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  padding: 24px 0 48px;
}

.ticket {
  text-align: center;
  padding: 8px 0;
  background: var(--card);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.ticket.sold {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.55;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px 0 48px;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: block;
  overflow: hidden;
}

.partner-logo {
  width: min(180px, 46vw);
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.event-card img,
.flyer-hero,
.flyer-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--paper-2);
}

.flyer-fallback {
  display: grid;
  place-items: center;
  font-size: 64px;
  color: var(--seal);
}

.event-card .meta {
  padding: 12px;
}

.event-card h3 {
  margin: 4px 0;
  font-size: 18px;
}

.event-detail {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 28px;
  padding: 28px 0 56px;
}

.cta {
  display: inline-block;
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--seal);
  color: var(--ink);
  text-decoration: none;
  background: #1a0f2c;
}

.cta:hover {
  color: var(--seal);
}

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

.profile-fab-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--seal);
  background: #1a0f2c;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 0;
  text-decoration: none;
}

.profile-fab-btn svg {
  width: 28px;
  height: 28px;
}

.profile-fab-btn:hover {
  color: var(--seal);
}

@media (max-width: 720px) {
  .profile-fab-btn {
    right: 14px;
  }

  .hero-art {
    grid-template-columns: 1fr;
  }

  .card {
    grid-template-columns: 48px 1fr;
  }

  .severity {
    grid-column: 2;
  }

  .card .details {
    grid-column: 1 / -1;
  }
}
