@font-face {
  font-family: "Tektur";
  src: url("fonts/tektur-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --brand-primary: #2afef5;
  --brand-secondary: #ff35a4;
  --brand-accent: #c7ff38;
  --brand-gradient: linear-gradient(90deg,
    var(--brand-primary) 0%,
    var(--brand-primary) 20%,
    var(--brand-secondary) 50%,
    var(--brand-secondary) 100%);
  --page: #061822;
  --page-deep: #041119;
  --surface: #09212c;
  --surface-2: #0c2935;
  --text: #f6fbff;
  --muted: #a5bac4;
  --line: #214653;
  --cyan: var(--brand-primary);
  --blue: #386cff;
  --pink: var(--brand-secondary);
  --violet: var(--brand-primary);
  --lime: var(--brand-accent);
  --yellow: #ffed39;
  --logo-blue: var(--brand-primary);
  --logo-pink: var(--brand-secondary);
}

html[data-theme="light"] {
  --page: #effaff;
  --page-deep: #dff4fb;
  --surface: #ffffff;
  --surface-2: #e8f7fc;
  --text: #071923;
  --muted: #516a76;
  --line: #a9ccd7;
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --page: #effaff;
    --page-deep: #dff4fb;
    --surface: #ffffff;
    --surface-2: #e8f7fc;
    --text: #071923;
    --muted: #516a76;
    --line: #a9ccd7;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--page);
  font-family: "Tektur", "Arial Narrow", sans-serif;
  line-height: 1.45;
}

button,
select,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.world-bg {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 62%, color-mix(in srgb, var(--brand-primary) 4%, transparent) 62% 62.2%, transparent 62.2%),
    linear-gradient(45deg, transparent 0 71%, color-mix(in srgb, var(--brand-secondary) 4%, transparent) 71% 71.2%, transparent 71.2%);
}

.world-bg::before,
.world-bg::after {
  display: none;
}

.world-bg i {
  position: absolute;
  width: 32vw;
  height: 2px;
  opacity: .16;
  background: var(--cyan);
  clip-path: none;
  filter: none;
  transform: rotate(-24deg);
}

.world-bg i:nth-child(1) { top: 24%; left: -9%; }
.world-bg i:nth-child(2) { top: 51%; right: -12%; background: var(--pink); transform: rotate(19deg); }
.world-bg i:nth-child(3) { bottom: 14%; left: 5%; background: var(--violet); transform: rotate(8deg); }
.world-bg i:nth-child(4) { top: 70%; right: 20%; background: var(--lime); transform: rotate(-13deg); }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  background: color-mix(in srgb, var(--page-deep) 95%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 25px rgb(0 0 0 / 18%);
}

.nav-shell {
  display: grid;
  grid-template-columns: 270px 1fr auto;
  align-items: center;
  gap: 28px;
  max-width: 1240px;
  min-height: 78px;
  margin: 0 auto;
  padding: 0 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  min-width: 0;
}

.wordmark img {
  display: block;
  width: auto;
  height: 48px;
  max-width: 190px;
  image-rendering: auto;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(3px 4px 0 rgb(0 237 255 / 16%));
}

.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 1.3vw, 20px);
  min-width: 0;
}

.main-nav a {
  position: relative;
  padding: 28px 0 23px;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .045em;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 15px;
  left: 0;
  height: 3px;
  content: "";
  background: var(--brand-gradient);
  transform: scaleX(0);
  transition: transform .2s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-control,
.account-chip {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.theme-control {
  gap: 6px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.theme-control > span {
  color: var(--violet);
}

.theme-control select {
  width: 76px;
  min-height: 34px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: .66rem;
  font-weight: 900;
  text-transform: uppercase;
  outline: none;
}

.theme-control option {
  color: #071923;
  background: white;
}

.account-chip {
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  color: white;
  background: var(--brand-gradient);
  border: 0;
  font-size: .76rem;
  font-weight: 900;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.menu-toggle {
  display: none;
}

.spectrum-line {
  height: 5px;
  background: var(--brand-gradient);
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 55px 0 80px;
}

.page-home {
  padding-top: 55px;
}

.hero {
  position: relative;
  min-height: 430px;
  padding: clamp(36px, 6vw, 74px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgb(255 255 255 / 18%);
  box-shadow: 0 22px 55px rgb(0 0 0 / 22%);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}

.hero::before,
.hero::after {
  display: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  max-width: 650px;
  margin: 0;
  font-size: clamp(3.4rem, 7.4vw, 7rem);
  line-height: .84;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.hero h1 span {
  color: var(--text);
  font-size: .62em;
  line-height: 1;
}

.hero h1 strong {
  align-self: flex-start;
  width: fit-content;
  margin-top: 8px;
  color: transparent;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.action {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-width: 190px;
  min-height: 50px;
  padding: 0 22px;
  color: #fff;
  background: #071923;
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.action span {
  color: var(--lime);
  font-size: 1.15rem;
}

.action-primary {
  color: white;
  background: var(--brand-gradient);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
}

.action-primary span {
  color: white;
}

.hero-mark {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 2%;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 47%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.game-field {
  position: relative;
  display: grid;
  place-items: center;
  width: min(500px, 100%);
  aspect-ratio: 1.65;
}

.game-field > img {
  position: relative;
  z-index: 5;
  width: 88%;
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,.45));
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 52px 0 20px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.section-title > a {
  color: var(--lime);
  font-size: .78rem;
  font-weight: 900;
}

.launch-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 16px;
}

.launch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 124px;
  padding: 25px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 13px 32px rgb(0 0 0 / 15%);
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.launch-card::after {
  position: absolute;
  right: -60px;
  bottom: -70px;
  width: 140px;
  height: 140px;
  content: "";
  background: none;
  border: 18px solid rgba(0,237,255,.05);
  transform: rotate(38deg);
}

.launch-card:hover,
.launch-card:focus-visible {
  z-index: 2;
  border-color: var(--cyan);
  background: var(--surface-2);
  transform: translateY(-5px);
}

.launch-card-featured {
  background: var(--brand-gradient);
  border-color: var(--brand-secondary);
}

.card-label {
  color: var(--cyan);
}

.card-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--lime);
  font-size: 1.5rem;
}

.launch-card strong {
  display: block;
  max-width: 280px;
  margin: auto 42px auto 0;
  font-size: 1.35rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.anchor-target {
  display: block;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  min-height: 100px;
  padding: 24px max(24px, calc((100% - 1180px) / 2));
  background: var(--page-deep);
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.footer-brand img {
  width: auto;
  height: 36px;
  max-width: 130px;
  image-rendering: auto;
  object-fit: contain;
}

.footer-brand span {
  color: var(--pink);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.footer-identity p {
  max-width: 600px;
  margin: 5px 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .65rem;
  font-weight: 650;
  line-height: 1.45;
}

.site-footer nav {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--cyan);
}

.page-mast {
  align-items: center;
  align-content: center;
}

.page-mast::after,
.kicker::before,
.song-card::after,
.rules-intro::after,
.rank-spotlight::after,
.country-ranking-summary article::after,
.country-ranking-highlights > article::before,
.country-highlights > article::before,
.achievement-catalog-card::before,
.privacy-card::before {
  background: var(--brand-gradient);
}

.surface-heading,
.data-table thead {
  border-image: var(--brand-gradient) 1;
}

.tab-bar a:first-child.active,
.tab-bar a:last-child.active,
.filter-tabs a,
.pill-gradient,
.rank-spotlight .mini-action,
.leaderboard-filter .mini-action,
.profile-country-settings .mini-action,
.profile-rival-form .mini-action,
.country-participation-stats article:first-child,
.profile-visual,
.production-song-art .song-cover-fallback {
  border-color: transparent;
  color: #fff;
  background: var(--brand-gradient);
}

.country-participation-rate progress::-webkit-progress-value,
.achievement-progress progress::-webkit-progress-value {
  background: var(--brand-gradient);
}

.country-participation-rate progress::-moz-progress-bar,
.achievement-progress progress::-moz-progress-bar {
  background: var(--brand-gradient);
}

@media (max-width: 1180px) {
  .nav-shell {
    grid-template-columns: 1fr auto auto;
  }

  .main-nav {
    position: absolute;
    top: 83px;
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    background: var(--page-deep);
    border-bottom: 4px solid var(--pink);
    box-shadow: 0 22px 55px rgb(0 0 0 / 28%);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 12px;
  }

  .main-nav a::after {
    bottom: 5px;
  }

  .menu-toggle {
    display: block;
    padding: 8px 12px;
    border: 2px solid var(--line);
    color: var(--text);
    background: var(--surface);
    font-size: .72rem;
    font-weight: 900;
  }
}

@media (max-width: 980px) {
  .launch-grid {
    grid-template-columns: 1fr 1fr;
  }

  .launch-card-featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 78px; }

  .theme-control { display: none; }

  .nav-shell {
    grid-template-columns: 1fr auto auto;
    gap: 9px;
    min-height: 70px;
    padding-inline: 16px;
  }

  .wordmark img {
    height: 40px;
    max-width: 145px;
  }

  .main-nav { top: 75px; }

  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 24px;
  }

  .page-home { padding-top: 24px; }

  .hero {
    min-height: 520px;
    padding: 34px 25px;
  }

  .hero-copy { max-width: 100%; }

  .hero h1 {
    font-size: clamp(3.1rem, 18vw, 5rem);
  }

  .hero-mark {
    top: auto;
    right: 0;
    bottom: 20px;
    width: 100%;
    height: 170px;
  }

  .game-field { width: min(330px, 82%); }

  .launch-grid { grid-template-columns: 1fr; }

  .launch-card-featured { grid-column: auto; }

  .site-footer {
    display: grid;
    justify-content: center;
    text-align: center;
  }

  .site-footer .footer-brand,
  .site-footer nav {
    justify-content: center;
  }

  .site-footer nav { align-items: center; }
}

@media (max-width: 480px) {
  .wordmark img {
    height: 36px;
    max-width: 115px;
  }

  .account-chip {
    min-height: 38px;
    gap: 8px;
    padding: 0 10px;
    font-size: .62rem;
  }

  .menu-toggle {
    padding-inline: 9px;
    font-size: .64rem;
  }

  .hero h1 { font-size: 14vw; }

  .cta-row,
  .action { width: 100%; }

  .section-title { align-items: flex-start; }

  .section-title > a { display: none; }

  .launch-card { min-height: 112px; }

  .footer-brand {
    align-items: center;
    flex-direction: column;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}


/* Flat country UI: country filters and country-specific accents must not use gradients. */
.country-ranking-tabs a {
  border-color: var(--line) !important;
  color: var(--text) !important;
  background: var(--surface-2) !important;
}

.country-ranking-tabs a:hover,
.country-ranking-tabs a:focus-visible {
  border-color: var(--brand-primary) !important;
  background: var(--surface) !important;
}

.country-ranking-tabs a.is-active,
.country-ranking-tabs a[aria-current="page"] {
  border-color: var(--brand-primary) !important;
  color: #071923 !important;
  background: var(--brand-primary) !important;
}

.country-ranking-summary article::after,
.country-ranking-highlights > article::before,
.country-highlights > article::before {
  background: var(--brand-primary) !important;
}

.country-participation-stats article:first-child {
  border-color: var(--line) !important;
  color: var(--text) !important;
  background: var(--surface-2) !important;
}

.country-participation-rate progress::-webkit-progress-value {
  background: var(--brand-primary) !important;
}

.country-participation-rate progress::-moz-progress-bar {
  background: var(--brand-primary) !important;
}

/* 2026-08-30 polish pass: compact centred actions, flat decorative surfaces, repaired rules layout. */
.action {
  justify-content: center !important;
  gap: 0 !important;
  width: auto;
  min-width: 0;
  padding-inline: 28px;
  text-align: center;
}

.mini-action,
button.mini-action,
a.mini-action,
span.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  text-align: center;
}

/* Discord's brand button is intentionally the exception to the site's game-colour actions. */
.action-discord {
  gap: 11px !important;
  color: #fff !important;
  background: #5865f2 !important;
}

.action-discord:hover,
.action-discord:focus-visible {
  background: #4752c4 !important;
}

.discord-icon {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.discord-button-label {
  color: inherit !important;
  font-size: inherit !important;
}

/* Song titles now live directly in the score-table headings; the duplicate key above the table is gone. */
.score-table .score-song-heading {
  min-width: 170px;
  max-width: 220px;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.score-table .boss-song-heading {
  border-bottom-color: var(--yellow);
}

/* Repair the rules grid even when older redesign.css rules are still present on the server. */
.page-rules .rules-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
  margin-top: 18px;
}

.page-rules .rules-card {
  position: relative;
  display: block !important;
  min-width: 0 !important;
  min-height: 220px;
  padding: 34px 36px !important;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #102442;
}

.page-rules .rules-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: block !important;
  height: 5px;
  content: "" !important;
  background: var(--brand-gradient) !important;
}

.page-rules .rules-card > div {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

.page-rules .rules-card small {
  display: block;
  margin: 8px 0 14px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.page-rules .rules-card h2 {
  display: block;
  width: 100%;
  max-width: none !important;
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.1;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.page-rules .rules-card p {
  display: block;
  width: 100%;
  max-width: none !important;
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}


.page-privacy .privacy-policy-grid {
  margin-top: 18px;
}

/* Remove the old geometric decoration system while keeping structural borders and content. */
.page-mast::before,
.page-mast::after,
.kicker::before,
.kicker::after,
.song-card::before,
.song-card::after,
.rules-intro::before,
.rules-intro::after,
.rank-spotlight::before,
.rank-spotlight::after,
.country-ranking-summary article::before,
.country-ranking-summary article::after,
.country-ranking-highlights > article::before,
.country-ranking-highlights > article::after,
.country-highlights > article::before,
.country-highlights > article::after,
.achievement-catalog-card::before,
.achievement-catalog-card::after,
.privacy-card::before,
.privacy-card::after,
.launch-card::before,
.launch-card::after,
.community-join::before,
.community-join::after,
.recap-hero::before,
.recap-hero::after,
.profile-visual::before,
.profile-visual::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
}

@media (max-width: 760px) {
  .page-rules .rules-grid {
    grid-template-columns: 1fr !important;
  }

  .page-rules .rules-card {
    min-height: 0;
    padding: 28px 24px !important;
  }
}

/* 2026-08-30 flat-colour pass: archive stats, difficulty tabs, rules, countries and page headers. */

/* Archive summary cards all use the same neutral surface as the first card. */
.archive-stats article,
.archive-stats article:nth-child(1),
.archive-stats article:nth-child(2),
.archive-stats article:nth-child(3) {
  color: var(--text) !important;
  background: #081d2c !important;
  background-image: none !important;
  border-color: var(--line) !important;
}

.archive-stats article::before,
.archive-stats article::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.archive-stats article small {
  color: var(--text) !important;
}

.archive-stats article strong {
  color: var(--cyan) !important;
}

/* SOUND VOLTEX difficulty colours. */
.page-bracket .tab-bar a[href="/brackets/advanced"] {
  color: #fff !important;
  background: #f39a18 !important;
  background-image: none !important;
  border-color: #f39a18 !important;
}

.page-bracket .tab-bar a[href="/brackets/master"] {
  color: #fff !important;
  background: #9b4de3 !important;
  background-image: none !important;
  border-color: #9b4de3 !important;
}

.page-bracket .tab-bar a[href="/brackets/advanced"].active,
.page-bracket .tab-bar a[href="/brackets/master"].active {
  filter: brightness(1.08);
}

/* Bracket slots are simple 1-5/Boss labels with no duplicate descriptor above the title. */
.page-bracket .song-number {
  min-width: 0 !important;
  width: auto !important;
  text-align: center !important;
}

.page-bracket .song-copy h2:first-child {
  margin-top: 0 !important;
}

/* Player-count badges on country filters use black text for contrast. */
.country-ranking-tabs a b {
  color: #071923 !important;
}

/* Rules use the page itself as their background: no blue card fill and no spectrum line. */
.page-rules .rules-card,
.page-rules .rules-example {
  background: transparent !important;
  background-image: none !important;
}

.page-rules .surface-heading {
  border-image: none !important;
  border-color: var(--line) !important;
}

.page-rules .rules-card::before,
.page-rules .rules-card::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
}

/* Page mastheads are one flat colour everywhere; remove the old diagonal split/accent shape. */
.page-mast {
  background: #071e2e !important;
  background-image: none !important;
  clip-path: none !important;
  overflow: hidden;
}

.page-mast > div,
.page-mast .mast-actions {
  background: transparent !important;
  background-image: none !important;
  clip-path: none !important;
}

.page-mast::before,
.page-mast::after,
.page-mast > div::before,
.page-mast > div::after,
.page-mast .mast-actions::before,
.page-mast .mast-actions::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
  clip-path: none !important;
}

/* 2026-08-30 outline-button pass: preserve spectrum accents, remove gradient fills. */

/* Song detail history: one heading, flat panel, but keep the cyan-purple divider line. */
.song-bracket-history,
.song-bracket-history .surface-heading {
  background: var(--surface) !important;
  background-image: none !important;
}

.song-bracket-history .surface-heading {
  border-image: var(--brand-gradient) 1 !important;
}

.song-bracket-history .surface-heading h2 {
  margin: 0 !important;
}

/* Gradient actions now use the spectrum only as an outline. */
.account-chip,
.action-primary,
.launch-card-featured,
.filter-tabs a,
.pill-gradient,
.rank-spotlight .mini-action,
.leaderboard-filter .mini-action,
.profile-country-settings .mini-action,
.profile-rival-form .mini-action {
  position: relative;
  isolation: isolate;
  color: var(--text) !important;
  border-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

.account-chip::before,
.action-primary::before,
.launch-card-featured::before,
.filter-tabs a::before,
.pill-gradient::before,
.rank-spotlight .mini-action::before,
.leaderboard-filter .mini-action::before,
.profile-country-settings .mini-action::before,
.profile-rival-form .mini-action::before {
  position: absolute !important;
  z-index: -2 !important;
  inset: 0 !important;
  display: block !important;
  content: "" !important;
  background: var(--brand-gradient) !important;
  background-image: var(--brand-gradient) !important;
  clip-path: inherit;
  pointer-events: none;
}

.account-chip::after,
.action-primary::after,
.launch-card-featured::after,
.filter-tabs a::after,
.pill-gradient::after,
.rank-spotlight .mini-action::after,
.leaderboard-filter .mini-action::after,
.profile-country-settings .mini-action::after,
.profile-rival-form .mini-action::after {
  position: absolute !important;
  z-index: -1 !important;
  inset: 2px !important;
  display: block !important;
  content: "" !important;
  background: var(--surface) !important;
  background-image: none !important;
  clip-path: inherit;
  pointer-events: none;
}

/* Keep text/icons above the generated outline layers. */
.account-chip > *,
.action-primary > *,
.launch-card-featured > *,
.filter-tabs a > *,
.pill-gradient > *,
.rank-spotlight .mini-action > *,
.leaderboard-filter .mini-action > *,
.profile-country-settings .mini-action > *,
.profile-rival-form .mini-action > * {
  position: relative;
  z-index: 1;
}

/* The two bracket-type tabs use their in-game colours as borders only. */
.page-bracket .tab-bar a[href="/brackets/advanced"],
.page-bracket .tab-bar a[href="/brackets/master"] {
  color: var(--text) !important;
  background: var(--surface) !important;
  background-image: none !important;
  filter: none !important;
}

.page-bracket .tab-bar a[href="/brackets/advanced"] {
  border: 3px solid #f39a18 !important;
}

.page-bracket .tab-bar a[href="/brackets/master"] {
  border: 3px solid #9b4de3 !important;
}

.page-bracket .tab-bar a[href="/brackets/advanced"].active {
  color: #f6b24b !important;
}

.page-bracket .tab-bar a[href="/brackets/master"].active {
  color: #bd7cf1 !important;
}

/* Player placement spotlight is one flat surface instead of a grey/teal gradient. */
.rank-spotlight,
.rank-spotlight > div {
  background: var(--surface) !important;
  background-image: none !important;
}

.rank-spotlight::before,
.rank-spotlight::after,
.rank-spotlight > div::before,
.rank-spotlight > div::after {
  background-image: none !important;
}

.rank-spotlight .spotlight-rank {
  background: var(--surface-2) !important;
  background-image: none !important;
}


/* 2026-08-30 flat-panel pass: remove the remaining grey/red gradient fills. */

/* Generic old gradient panels are now normal flat surfaces site-wide. */
.gradient-panel,
.rank-signin,
.map-summary,
.rival-summary,
.upcoming-bracket-preview {
  background: var(--surface) !important;
  background-image: none !important;
  box-shadow: none;
}

/* Remove decorative gradient layers from those panels as well. */
.gradient-panel::before,
.gradient-panel::after,
.rank-signin::before,
.rank-signin::after,
.map-summary::before,
.map-summary::after,
.rival-summary::before,
.rival-summary::after,
.upcoming-bracket-preview::before,
.upcoming-bracket-preview::after {
  background: none !important;
  background-image: none !important;
}

/* The Advanced eligibility notice is a plain dark panel, not a grey/teal fade. */
.rank-signin.bracket-eligibility {
  background: var(--surface) !important;
  background-image: none !important;
}

/* Locked/error notices can stay red, but only as one solid colour. */
.rank-signin.eligibility-lock,
.backup-danger-panel {
  background: #9f1f3b !important;
  background-image: none !important;
}

/* Brackets home card: dark interior, spectrum border only, no cube/shape. */
.launch-card.launch-card-featured {
  isolation: auto !important;
  border: 3px solid transparent !important;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--brand-gradient) border-box !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  clip-path: none !important;
  overflow: hidden;
}

.launch-card.launch-card-featured::before,
.launch-card.launch-card-featured::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
  border: 0 !important;
  clip-path: none !important;
  transform: none !important;
}

.launch-card.launch-card-featured > * {
  position: relative;
  z-index: 1;
}

/* All spectrum-filled action controls use the gradient only on their outline. */
.account-chip,
.action-primary,
.filter-tabs a,
.pill-gradient,
.rank-spotlight .mini-action,
.leaderboard-filter .mini-action,
.profile-country-settings .mini-action,
.profile-rival-form .mini-action {
  isolation: auto !important;
  border: 2px solid transparent !important;
  color: var(--text) !important;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--brand-gradient) border-box !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
}

.account-chip::before,
.account-chip::after,
.action-primary::before,
.action-primary::after,
.filter-tabs a::before,
.filter-tabs a::after,
.pill-gradient::before,
.pill-gradient::after,
.rank-spotlight .mini-action::before,
.rank-spotlight .mini-action::after,
.leaderboard-filter .mini-action::before,
.leaderboard-filter .mini-action::after,
.profile-country-settings .mini-action::before,
.profile-country-settings .mini-action::after,
.profile-rival-form .mini-action::before,
.profile-rival-form .mini-action::after {
  display: none !important;
  content: none !important;
}

/* Bracket tabs keep only their in-game colour on the border in every state. */
.page-bracket .tab-bar a[href="/brackets/advanced"],
.page-bracket .tab-bar a[href="/brackets/advanced"]:hover,
.page-bracket .tab-bar a[href="/brackets/advanced"]:focus-visible,
.page-bracket .tab-bar a[href="/brackets/advanced"].active {
  color: #f6b24b !important;
  border: 3px solid #f39a18 !important;
  background: var(--surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.page-bracket .tab-bar a[href="/brackets/master"],
.page-bracket .tab-bar a[href="/brackets/master"]:hover,
.page-bracket .tab-bar a[href="/brackets/master"]:focus-visible,
.page-bracket .tab-bar a[href="/brackets/master"].active {
  color: #bd7cf1 !important;
  border: 3px solid #9b4de3 !important;
  background: var(--surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* 2026-08-30 slanted-outline hotfix.
   A normal CSS border/background-clip is rectangular and gets chopped by the
   action buttons' polygon clip-path. Draw the spectrum as two polygon layers
   instead so the outline follows every slanted edge continuously. */
.account-chip,
.action-primary,
.filter-tabs a,
.pill-gradient,
.rank-spotlight .mini-action,
.leaderboard-filter .mini-action,
.profile-country-settings .mini-action,
.profile-rival-form .mini-action {
  position: relative !important;
  isolation: isolate !important;
  border: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
  background-image: none !important;
}

.account-chip::before,
.action-primary::before,
.filter-tabs a::before,
.pill-gradient::before,
.rank-spotlight .mini-action::before,
.leaderboard-filter .mini-action::before,
.profile-country-settings .mini-action::before,
.profile-rival-form .mini-action::before {
  position: absolute !important;
  z-index: -2 !important;
  inset: 0 !important;
  display: block !important;
  content: "" !important;
  background: var(--brand-gradient) !important;
  background-image: var(--brand-gradient) !important;
  clip-path: inherit !important;
  pointer-events: none !important;
}

.account-chip::after,
.action-primary::after,
.filter-tabs a::after,
.pill-gradient::after,
.rank-spotlight .mini-action::after,
.leaderboard-filter .mini-action::after,
.profile-country-settings .mini-action::after,
.profile-rival-form .mini-action::after {
  position: absolute !important;
  z-index: -1 !important;
  inset: 2px !important;
  display: block !important;
  content: "" !important;
  background: var(--surface) !important;
  background-image: none !important;
  clip-path: inherit !important;
  pointer-events: none !important;
}

/* Preserve the solid Discord treatment. */
.action-discord,
.action-discord:hover,
.action-discord:focus-visible {
  background-image: none !important;
}

/* 2026-08-30 unified box surface pass.
   Every content box/panel uses the same solid competition-site navy (#102442).
   Accent borders/lines and button-outline gradients are intentionally preserved. */
:root {
  --surface: #102442;
  --surface-2: #102442;
  --theme-surface: #102442;
  --theme-surface-strong: #102442;
  --theme-surface-soft: #102442;
  --theme-field: #102442;
}

/* Core box primitives and mastheads. */
.surface,
.gradient-panel,
.page-mast,
.hero,
.launch-card,
.rank-signin,
.map-summary,
.rival-summary,
.upcoming-bracket-preview,
.search-hero,
.rank-spotlight,
.rank-spotlight > div,
.rank-spotlight .spotlight-rank,
.recap-hero,
.recap-preview-warning,
.rival-signin,
.achievement-player-banner,
.profile-visual,
.profile-external,
.profile-country-badge,
.profile-rival-record,
.profile-last-sync,
.admin-panel,
.admin-record,
.backup-danger-panel {
  background-color: #102442 !important;
  background-image: none !important;
}

/* Card/stat collections that older redesign.css gives grey/teal fills. */
.archive-stats > article,
.catalog-stats > article,
.community-stats > article,
.metric-grid > article,
.country-ranking-summary > article,
.country-ranking-highlights > article,
.country-highlights > article,
.country-participation-stats > article,
.profile-stat-grid > article,
.profile-chart-extremes > article,
.profile-lamp-statistics > article,
.rules-example-grid > article,
.rules-card,
.rules-example,
.rules-example > p,
.rules-example > .surface-heading,
.rules-example-grid,
.achievement-card,
.achievement-catalog-card,
.profile-possession-card,
.recap-chart-card,
.rival-card,
.song-card,
.privacy-policy-card,
.search-result-section,
.placement-history,
.profile-statistics,
.profile-score-history,
.profile-achievements,
.profile-country-settings,
.profile-privacy-settings,
.archive-list,
.song-bracket-history,
.recap-podium,
.recap-full-standings,
.admin-record-panel,
.admin-record-section,
.admin-moderation-section,
.admin-backup-summary,
.admin-player-country-panel,
.admin-achievement-panel,
.admin-private-backups,
.admin-catalog-versions,
.admin-sync-health,
.admin-error-log,
.admin-recent-activity,
.admin-player-directory,
.admin-achievement-management {
  background-color: #102442 !important;
  background-image: none !important;
}

/* Internal strips/headers should not introduce a second grey shade. */
.surface-heading,
.rules-example .surface-heading,
.song-bracket-history .surface-heading,
.archive-list .surface-heading,
.profile-statistics .surface-heading,
.profile-score-history .surface-heading,
.profile-achievements .surface-heading,
.profile-privacy-settings .surface-heading,
.placement-history .surface-heading,
.recap-podium .surface-heading,
.recap-full-standings .surface-heading,
.admin-record-panel .surface-heading,
.admin-moderation-section .surface-heading {
  background-color: #102442 !important;
  background-image: none !important;
}

/* The locked Advanced notice is a box too; keep its warning text but use the shared surface. */
.rank-signin.eligibility-lock,
.rank-signin.bracket-eligibility,
.rank-signin.bracket-frozen,
.backup-danger-panel {
  background-color: #102442 !important;
  background-image: none !important;
}

/* Preserve special button treatments while forcing their interiors to the shared navy. */
.account-chip::after,
.action-primary::after,
.filter-tabs a::after,
.pill-gradient::after,
.rank-spotlight .mini-action::after,
.leaderboard-filter .mini-action::after,
.profile-country-settings .mini-action::after,
.profile-rival-form .mini-action::after {
  background: #102442 !important;
  background-image: none !important;
}

:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/advanced"],
:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/master"] {
  background-color: #102442 !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/advanced"] {
  color: #f6b24b !important;
  border: 3px solid #f39a18 !important;
}

:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/master"] {
  color: #bd7cf1 !important;
  border: 3px solid #9b4de3 !important;
}

:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/advanced"]:hover,
:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/advanced"]:focus-visible {
  color: #071923 !important;
  background-color: #f39a18 !important;
  box-shadow: 0 8px 20px rgb(243 154 24 / 28%) !important;
  transform: translateY(-2px);
}

:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/master"]:hover,
:is(.page-bracket, .page-scores) .tab-bar a[href^="/brackets/master"]:focus-visible {
  color: #fff !important;
  background-color: #9b4de3 !important;
  box-shadow: 0 8px 20px rgb(155 77 227 / 30%) !important;
  transform: translateY(-2px);
}

/* Featured Brackets card keeps its cyan-purple outline while sharing the same solid navy fill. */
.launch-card.launch-card-featured {
  background: #102442 !important;
  background-image: none !important;
  border: 3px solid transparent !important;
  border-image: var(--brand-gradient) 1 !important;
}

/* 2026-08-30 possession/profile cleanup.
   Possession cards keep their in-game tier colour; the profile identity box is flat. */
.profile-identity,
.profile-layout > .profile-identity {
  background-color: #102442 !important;
  background-image: none !important;
}

/* Older profile CSS adds the large decorative/rainbow corner ring with pseudo-elements. */
.profile-identity::before,
.profile-identity::after,
.profile-layout::before,
.profile-layout::after,
.page-profile::before,
.page-profile::after {
  display: none !important;
  content: none !important;
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Do not let the generic unified-surface rule wash out possession tiers. */
.profile-possession-card {
  background-image: none !important;
}

.profile-possession-card.profile-possession-none,
.profile-possession-card.profile-possession-unavailable {
  color: var(--text) !important;
  background-color: #102442 !important;
  border-color: var(--line) !important;
}

/* Legacy profile-tier colours kept for database-compatible templates. */
.profile-possession-card.profile-possession-silver {
  color: #000 !important;
  background-color: #b9d9e8 !important;
  border-color: #e9f7ff !important;
}

.profile-possession-card.profile-possession-gold {
  color: #000 !important;
  background-color: #f2cc45 !important;
  border-color: #fff0a8 !important;
}

.profile-possession-card.profile-possession-platinum {
  color: #000 !important;
  background-color: #8fd8f5 !important;
  border-color: #dff7ff !important;
}

.profile-possession-card.profile-possession-rainbow {
  color: #000 !important;
  background-color: #a95de8 !important;
  border-color: #e1b8ff !important;
}

.profile-possession-card.profile-possession-silver small,
.profile-possession-card.profile-possession-silver strong,
.profile-possession-card.profile-possession-silver span,
.profile-possession-card.profile-possession-gold small,
.profile-possession-card.profile-possession-gold strong,
.profile-possession-card.profile-possession-gold span,
.profile-possession-card.profile-possession-platinum small,
.profile-possession-card.profile-possession-platinum strong,
.profile-possession-card.profile-possession-platinum span,
.profile-possession-card.profile-possession-rainbow small,
.profile-possession-card.profile-possession-rainbow strong,
.profile-possession-card.profile-possession-rainbow span {
  color: inherit !important;
  opacity: 1 !important;
}

/* Keep both lines legible against every coloured possession badge. */
.possession-silver,
.possession-silver b,
.possession-silver small,
.possession-gold,
.possession-gold b,
.possession-gold small,
.possession-platinum,
.possession-platinum b,
.possession-platinum small,
.possession-rainbow,
.possession-rainbow b,
.possession-rainbow small {
  color: #000 !important;
}

/* 2026-08-30 final flat-box coverage.
   These components are styled in the legacy redesign stylesheet rather than this
   template, so explicitly neutralize their old grey/teal gradients here. */
.community-join,
.rival-bracket-meta,
.rival-management,
.rival-comparison,
.search-result-summary,
.profile-stat-details,
.profile-rival-full,
.profile-rival-record,
.home-upcoming-brackets > div > a,
.recap-metrics > article,
.recap-podium-grid > article,
.admin-dashboard-metrics > article,
.backup-count-grid > article,
.admin-notice,
.admin-topline,
.admin-sidebar,
.admin-workspace {
  background-color: #102442 !important;
  background-image: none !important;
  box-shadow: none;
}

.community-join::before,
.community-join::after,
.rival-bracket-meta::before,
.rival-bracket-meta::after,
.rival-management::before,
.rival-management::after,
.rival-comparison::before,
.rival-comparison::after,
.search-result-summary::before,
.search-result-summary::after,
.profile-stat-details::before,
.profile-stat-details::after,
.profile-rival-full::before,
.profile-rival-full::after,
.home-upcoming-brackets > div > a::before,
.home-upcoming-brackets > div > a::after,
.recap-metrics > article::before,
.recap-metrics > article::after,
.recap-podium-grid > article::before,
.recap-podium-grid > article::after,
.admin-dashboard-metrics > article::before,
.admin-dashboard-metrics > article::after,
.backup-count-grid > article::before,
.backup-count-grid > article::after {
  background: none !important;
  background-image: none !important;
}

/* Community keeps the Discord-purple action, but the surrounding box is flat navy. */
.community-join .action-discord {
  background-color: #5865f2 !important;
  background-image: none !important;
}


/* Open Discord shortcut uses the site purple instead of the yellow accent. */
.section-title > a.open-discord-link {
  color: var(--brand-secondary) !important;
}

/* 2026-08-30 achievement-page flat-surface hardening.
   Legacy achievement rules can reintroduce gradients after the shared box styles,
   so every achievement container is explicitly flattened here at highest priority. */
.page-achievements .achievement-player-banner,
.page-achievements .achievement-category-nav,
.page-achievements .achievement-category-nav > a,
.page-achievements .achievement-category,
.page-achievements .achievement-category-heading,
.page-achievements .achievement-catalog-grid,
.page-achievements .achievement-catalog-card,
.page-achievements .achievement-catalog-copy,
.page-achievements .achievement-progress,
.profile-achievements,
.profile-achievements .achievement-grid,
.profile-achievements .achievement-card {
  background-color: #102442 !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Remove decorative/gradient layers from every achievement box. */
.page-achievements .achievement-player-banner::before,
.page-achievements .achievement-player-banner::after,
.page-achievements .achievement-category-nav::before,
.page-achievements .achievement-category-nav::after,
.page-achievements .achievement-category-nav > a::before,
.page-achievements .achievement-category-nav > a::after,
.page-achievements .achievement-category::before,
.page-achievements .achievement-category::after,
.page-achievements .achievement-category-heading::before,
.page-achievements .achievement-category-heading::after,
.page-achievements .achievement-catalog-grid::before,
.page-achievements .achievement-catalog-grid::after,
.page-achievements .achievement-catalog-card::before,
.page-achievements .achievement-catalog-card::after,
.profile-achievements::before,
.profile-achievements::after,
.profile-achievements .achievement-card::before,
.profile-achievements .achievement-card::after {
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Category headers keep a simple cyan marker, never a gradient fill. */
.page-achievements .achievement-category-heading {
  border-left-color: var(--brand-primary) !important;
}

/* Achievement progress is an accent, but it is flat rather than spectrum-filled. */
.page-achievements .achievement-progress progress::-webkit-progress-value,
.profile-achievements .achievement-progress progress::-webkit-progress-value {
  background: var(--brand-primary) !important;
  background-image: none !important;
}

.page-achievements .achievement-progress progress::-moz-progress-bar,
.profile-achievements .achievement-progress progress::-moz-progress-bar {
  background: var(--brand-primary) !important;
  background-image: none !important;
}

/* The external profile link is a distinct Kamaitachi action, not a navy panel. */
a.mini-action.profile-external {
  color: #fff !important;
  background-color: #ff3150 !important;
  background-image: none !important;
}

a.mini-action.profile-external:hover,
a.mini-action.profile-external:focus-visible {
  color: #fff !important;
  background-color: #d91f3c !important;
  background-image: none !important;
}

/* 2026-09-01 bracket layout: use wide screens, condense score context, and improve mappool labels. */
.page {
  width: min(1600px, calc(100% - 40px));
}

.page-scores {
  width: min(1920px, calc(100% - 32px));
}

.nav-shell,
.utility-bar {
  max-width: 1600px;
}

.bracket-song-summary {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.bracket-song-summary > div {
  border-right: 0;
}

.page-bracket .version-chip {
  border-color: #fff;
  color: #fff;
}

.score-bracket-summary {
  display: flex;
  min-height: 154px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 10px;
  padding: 28px 34px;
  color: #fff;
  background: #102442;
}

.score-bracket-title h2 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 5rem);
  letter-spacing: -.055em;
  line-height: .82;
  text-transform: uppercase;
}

.score-bracket-title p {
  margin: 12px 0 0;
  font-size: clamp(1rem, 1.7vw, 1.42rem);
  font-weight: 900;
  line-height: 1;
}

.score-bracket-name {
  display: grid;
  max-width: 520px;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.score-bracket-name small {
  color: var(--cyan);
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.score-bracket-name strong {
  font-size: .9rem;
  text-transform: uppercase;
}

.bracket-rating-stack {
  display: grid;
  gap: 4px;
  line-height: 1;
}

.page-scores .bracket-rating {
  color: var(--cyan);
}

.bracket-rating-stack small {
  color: var(--cyan);
  font-family: Tektur, sans-serif;
  font-size: .68rem;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .page,
  .page-scores {
    width: calc(100% - 24px);
  }

  .bracket-song-summary,
  .score-bracket-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bracket-song-summary p {
    text-align: left;
  }

  .score-bracket-name {
    justify-items: start;
    text-align: left;
  }
}
