/* Shared styles for the Morrowind Modding Madness section.
   Pages under /madness link this from <head>; the nav markup itself
   comes from nav.js (<madness-nav>). */

:root {
  --mm-bg-deep: #141210;   /* html/body backdrop */
  --mm-bg: #1e1b19;        /* page surface */
  --mm-bg-panel: #181614;  /* stats / filter strips */
  --mm-bg-footer: #12100e;
  --mm-ink: #e8e0cd;       /* parchment text */
  --mm-gold: #e8b23a;      /* accents, active links */
  --mm-gold-bright: #f2c96b; /* hover */
  --mm-line: rgba(232, 224, 205, .15);
  --mm-display: Cinzel, serif;
  --mm-serif: Alegreya, serif;
  --mm-fell: 'IM Fell English', serif;
}

body {
  margin: 0;
  background: var(--mm-bg-deep);
}

a {
  color: var(--mm-gold);
  text-decoration: none;
}

a:hover {
  color: var(--mm-gold-bright);
}

select,
input {
  outline: none;
}

.mm-filter-clear {
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  place-items: center;
  color: var(--mm-gold);
  background: transparent;
  border: 1px solid rgba(232, 178, 58, .55);
  cursor: pointer;
}

.mm-filter-clear:hover,
.mm-filter-clear:focus-visible {
  color: var(--mm-gold-bright);
  background: rgba(232, 178, 58, .08);
  border-color: var(--mm-gold-bright);
  outline: none;
}

.clear-filters-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 17px;
}

.clear-filters-icon::before {
  position: absolute;
  top: 2px;
  left: 1px;
  width: 13px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 64% 47%, 64% 100%, 38% 82%, 38% 47%);
  content: "";
}

.clear-filters-icon::after {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font: 700 12px/1 Arial, sans-serif;
  content: "×";
}

.mm-week-divider {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 22px 6px 6px;
  color: var(--mm-gold);
}

.mm-week-divider > span {
  height: 1px;
  background: rgba(232, 178, 58, .38);
}

.mm-week-divider strong {
  font-family: var(--mm-display);
  font-size: 11px;
  letter-spacing: .22em;
}

/* ---- Madness 2026 countdown ---- */

.mm-countdown {
  padding: 30px 40px 28px;
  border-top: 1px solid rgba(232, 178, 58, .3);
  border-bottom: 1px solid var(--mm-line);
  background:
    radial-gradient(circle at 14% 30%, rgba(214, 51, 132, .12), transparent 32%),
    linear-gradient(105deg, #171311, #211916 56%, #171311);
  color: var(--mm-ink);
  font-family: var(--mm-serif);
}

.mm-countdown--submissions {
  border-top-color: rgba(63, 191, 176, .55);
}

.mm-countdown--bugfix {
  border-top-color: rgba(242, 140, 40, .65);
}

.mm-countdown-main {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 34px;
}

.mm-countdown-eyebrow {
  margin-bottom: 6px;
  color: #d63384;
  font-family: var(--mm-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

.mm-countdown--submissions .mm-countdown-eyebrow {
  color: #3fbfb0;
}

.mm-countdown--bugfix .mm-countdown-eyebrow {
  color: #f28c28;
}

.mm-countdown-title {
  margin: 0;
  color: var(--mm-ink);
  font-family: var(--mm-display);
  font-size: clamp(21px, 2.2vw, 29px);
  line-height: 1.15;
  letter-spacing: .025em;
}

.mm-countdown--over .mm-countdown-main {
  display: block;
  text-align: center;
}

.mm-countdown--over .mm-countdown-title {
  color: var(--mm-gold-bright);
}

.mm-countdown-detail {
  margin-top: 7px;
  font-size: 14px;
  opacity: .72;
}

.mm-countdown-clock {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-countdown-segment {
  width: 72px;
  padding: 11px 7px 9px;
  border: 1px solid rgba(232, 224, 205, .18);
  background: rgba(10, 9, 8, .52);
  text-align: center;
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.mm-countdown-value {
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.mm-countdown-unit {
  margin-top: 6px;
  font-family: var(--mm-display);
  font-size: 8px;
  letter-spacing: .14em;
  opacity: .62;
}

.mm-countdown-timeline {
  display: grid;
  max-width: 1180px;
  margin: 25px auto 0;
  padding: 21px 0 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--mm-line);
  list-style: none;
}

.mm-countdown-milestone {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: center;
  padding-right: 16px;
}

.mm-countdown-milestone:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 22px;
  height: 1px;
  background: var(--mm-line);
  content: '';
}

.mm-countdown-marker {
  width: 9px;
  height: 9px;
  flex: none;
  border: 1px solid rgba(232, 224, 205, .42);
  border-radius: 50%;
  background: #211d1a;
}

.mm-countdown-milestone--complete .mm-countdown-marker {
  border-color: var(--mm-gold);
  background: var(--mm-gold);
}

.mm-countdown-milestone--active .mm-countdown-marker {
  border-color: #d63384;
  background: #d63384;
  box-shadow: 0 0 0 4px rgba(214, 51, 132, .13);
}

.mm-countdown-milestone-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.mm-countdown-milestone-label {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-countdown-milestone time {
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}

.mm-countdown-milestone--upcoming {
  opacity: .52;
}

@media (max-width: 820px) {
  .mm-countdown-main {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .mm-countdown-clock {
    justify-content: center;
  }

  .mm-countdown-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px 24px;
  }

  .mm-countdown-milestone:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .mm-countdown {
    padding: 25px 20px 24px;
  }

  .mm-countdown-clock {
    gap: 5px;
  }

  .mm-countdown-segment {
    width: auto;
    min-width: 0;
    flex: 1;
    padding: 10px 4px 8px;
  }

  .mm-countdown-value {
    font-size: clamp(19px, 7vw, 26px);
  }

  .mm-countdown-timeline {
    grid-template-columns: 1fr;
  }

  .mm-countdown-milestone-label {
    white-space: normal;
  }
}

/* ---- Madness 2026 registration ---- */

.mm-register {
  scroll-margin-top: 24px;
  padding: 54px 40px 58px;
  border-bottom: 1px solid var(--mm-line);
  background:
    radial-gradient(circle at 12% 20%, rgba(214, 51, 132, .13), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(232, 178, 58, .08), transparent 28%),
    #181513;
  color: var(--mm-ink);
  font-family: var(--mm-serif);
}

.mm-register-inner {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  grid-template-columns: minmax(250px, .72fr) minmax(460px, 1.28fr);
  gap: clamp(38px, 6vw, 82px);
  align-items: start;
}

.mm-register-intro {
  position: sticky;
  top: 28px;
  padding-top: 22px;
}

.mm-register-eyebrow,
.mm-register-closed-eyebrow {
  color: #d63384;
  font-family: var(--mm-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
}

.mm-register-title {
  margin: 10px 0 18px;
  color: var(--mm-ink);
  font-family: var(--mm-display);
  font-size: clamp(28px, 3.1vw, 43px);
  font-weight: 850;
  line-height: 1.03;
  letter-spacing: .04em;
}

.mm-register-intro p {
  max-width: 430px;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  opacity: .82;
}

.mm-register-intro .mm-register-window {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(232, 178, 58, .28);
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  opacity: 1;
  text-transform: uppercase;
}

.mm-register-rules-link {
  display: inline-block;
  margin-top: 19px;
  font-family: var(--mm-fell);
  font-size: 16px;
  font-style: italic;
}

.mm-register-card {
  border: 1px solid rgba(232, 224, 205, .22);
  background: rgba(30, 27, 25, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .025);
}

.mm-register-test {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(214, 51, 132, .45);
  background: rgba(214, 51, 132, .13);
  color: #f4b8d6;
  font-family: var(--mm-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
}

.mm-register-form {
  padding: clamp(24px, 4vw, 38px);
}

.mm-register-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.mm-register-field label,
.mm-register-members legend {
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mm-register-field input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(232, 224, 205, .28);
  border-radius: 0;
  background: #12100e;
  color: var(--mm-ink);
  font-family: var(--mm-serif);
  font-size: 17px;
  padding: 12px 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.mm-register-field input::placeholder {
  color: rgba(232, 224, 205, .36);
}

.mm-register-field input:focus {
  border-color: var(--mm-gold-bright);
  box-shadow: 0 0 0 3px rgba(232, 178, 58, .12);
}

.mm-register-optional {
  margin-left: 5px;
  color: var(--mm-ink);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .1em;
  opacity: .48;
}

.mm-register-members {
  min-width: 0;
  margin: 29px 0 0;
  padding: 0;
  border: 0;
}

.mm-register-members legend {
  margin-bottom: 12px;
}

.mm-register-member-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mm-register-member {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(280px, 1.3fr);
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(232, 224, 205, .1);
}

.mm-register-member:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mm-register-actions {
  display: flex;
  margin: 22px 0 28px;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mm-register-add,
.mm-register-submit {
  border-radius: 0;
  font-family: var(--mm-display);
  font-weight: 800;
  letter-spacing: .11em;
  cursor: pointer;
}

.mm-register-add {
  padding: 9px 12px;
  border: 1px solid rgba(232, 224, 205, .38);
  background: transparent;
  color: var(--mm-ink);
  font-size: 10px;
}

.mm-register-add:hover,
.mm-register-add:focus-visible {
  border-color: var(--mm-gold-bright);
  color: var(--mm-gold-bright);
}

.mm-register-count,
.mm-register-limit {
  font-size: 13px;
  opacity: .58;
}

.mm-register-count {
  margin-left: auto;
}

.mm-register-submit {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #d63384;
  background: #d63384;
  color: #fff;
  font-size: 12px;
}

.mm-register-submit:hover,
.mm-register-submit:focus-visible {
  border-color: #e64a97;
  background: #e64a97;
}

.mm-register-submit:disabled {
  border-color: rgba(232, 224, 205, .18);
  background: rgba(232, 224, 205, .06);
  color: rgba(232, 224, 205, .42);
  cursor: not-allowed;
}

.mm-register-setup {
  margin: 12px 0 0;
  color: rgba(232, 224, 205, .62);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.mm-register-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.mm-register-card--closed {
  min-height: 330px;
  padding: 42px;
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.mm-register-seal {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border: 1px solid rgba(232, 178, 58, .55);
  border-radius: 50%;
  place-items: center;
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(232, 178, 58, .045);
}

.mm-register-card--closed h2,
.mm-register-card--closed h3 {
  margin: 9px 0 12px;
  color: var(--mm-ink);
  font-family: var(--mm-display);
  font-size: clamp(22px, 2.7vw, 32px);
  letter-spacing: .04em;
}

.mm-register-card--closed p {
  max-width: 470px;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  opacity: .7;
}

@media (max-width: 820px) {
  .mm-register-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .mm-register-intro {
    position: static;
    padding-top: 0;
  }

  .mm-register-intro p {
    max-width: 620px;
  }
}

@media (max-width: 520px) {
  .mm-register {
    padding: 40px 20px 44px;
  }

  .mm-register-member {
    grid-template-columns: 1fr;
  }

  .mm-register-card--closed {
    min-height: 290px;
    padding: 30px 22px;
  }

  .mm-register-count {
    width: 100%;
    margin-left: 0;
  }
}

/* Past Madness winners are distinguished in the full modder roster. */
.mm-modder-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--mm-line);
  padding: 16px;
  background: #1a1715;
}

.mm-modder-card-champion {
  border-color: var(--mm-gold);
  background:
    linear-gradient(rgba(232, 178, 58, .055), rgba(232, 178, 58, .055)),
    #1a1715;
  box-shadow:
    inset 0 0 0 2px rgba(242, 201, 107, .16),
    0 0 14px rgba(232, 178, 58, .09);
}

/* ---- Madness modder profiles ---- */

.mm-profile-page {
  min-height: 100vh;
  background: var(--mm-bg);
  color: var(--mm-ink);
  font-family: var(--mm-serif);
}

.mm-profile-shell {
  width: min(1180px, calc(100% - 80px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.mm-profile-back {
  display: inline-block;
  margin-bottom: 22px;
  font-family: var(--mm-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.mm-profile-hero,
.mm-profile-panel {
  border: 1px solid var(--mm-line);
  background: #1a1715;
}

.mm-profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, .9fr);
}

.mm-profile-identity {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 38px;
  background: radial-gradient(circle at 16% 20%, rgba(232, 178, 58, .09), transparent 42%);
}

.mm-profile-avatar {
  width: 112px;
  height: 112px;
  flex: none;
  border: 1px solid rgba(232, 224, 205, .35);
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

.mm-profile-avatar-fallback,
.mm-pairing-fallback {
  display: grid;
  place-items: center;
  background: #2a2522;
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-weight: 800;
}

.mm-profile-kicker {
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
}

.mm-profile-identity h1,
.mm-profile-message h1 {
  margin: 6px 0 16px;
  font-family: var(--mm-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .03em;
  overflow-wrap: anywhere;
}

.mm-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mm-button {
  display: inline-block;
  border: 1px solid rgba(232, 178, 58, .6);
  padding: 8px 11px;
  font-family: var(--mm-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.mm-button-quiet {
  border-color: rgba(232, 224, 205, .25);
  color: var(--mm-ink);
}

.mm-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-left: 1px solid var(--mm-line);
}

.mm-profile-stat {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--mm-line);
  box-sizing: border-box;
}

.mm-profile-stat:nth-child(odd) {
  border-right: 1px solid var(--mm-line);
}

.mm-profile-stat:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.mm-profile-stat-streak {
  background: rgba(232, 178, 58, .045);
}

.mm-profile-stat-value {
  font-family: var(--mm-display);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
}

.mm-profile-stat-place {
  font-size: 18px;
}

.mm-profile-stat-label {
  margin-top: 7px;
  font-family: var(--mm-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
  opacity: .65;
}

.mm-profile-stat-detail {
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  opacity: .55;
}

.mm-profile-columns {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.mm-profile-panel {
  padding: 26px;
}

.mm-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--mm-line);
}

.mm-section-heading h2 {
  margin: 5px 0 0;
  font-family: var(--mm-display);
  font-size: 18px;
  letter-spacing: .08em;
}

.mm-section-heading > span {
  flex: none;
  font-family: var(--mm-display);
  font-size: 10px;
  letter-spacing: .14em;
  opacity: .55;
}

.mm-history-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 100px;
  gap: 12px;
  align-items: baseline;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(232, 224, 205, .09);
  color: var(--mm-ink);
}

.mm-history-row:hover {
  color: var(--mm-gold-bright);
}

.mm-history-year,
.mm-submission-year > span {
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.mm-history-team {
  font-size: 16px;
  font-weight: 700;
}

.mm-place {
  font-family: var(--mm-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-align: right;
}

.mm-pairing-list {
  display: flex;
  flex-direction: column;
}

.mm-pairing {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(232, 224, 205, .09);
  color: var(--mm-ink);
}

.mm-pairing:hover {
  color: var(--mm-gold-bright);
}

.mm-pairing img,
.mm-pairing-fallback {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(232, 224, 205, .25);
  box-sizing: border-box;
  object-fit: cover;
}

.mm-pairing-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mm-pairing-name small,
.mm-pairing-count small,
.mm-submission-year small,
.mm-submission-title small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: italic;
  font-weight: 400;
  opacity: .5;
}

.mm-pairing-count {
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-size: 17px;
  font-weight: 800;
  text-align: right;
}

.mm-pairing-count small {
  font-family: var(--mm-display);
  font-size: 7px;
  font-style: normal;
  letter-spacing: .12em;
}

.mm-panel-empty {
  padding: 42px 12px;
  text-align: center;
  font-family: var(--mm-fell);
  font-size: 17px;
  font-style: italic;
  opacity: .55;
}

.mm-submissions-panel {
  margin-top: 18px;
}

.mm-placement-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 2px;
}

.mm-placement-summary > span {
  padding: 3px 0;
  font-family: var(--mm-display);
  font-size: 9px;
  letter-spacing: .08em;
}

.mm-placement-summary b {
  margin-right: 3px;
  font-size: 12px;
}

.mm-submission-group {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 24px;
  padding: 23px 0 5px;
  border-bottom: 1px solid var(--mm-line);
}

.mm-submission-group:last-child {
  border-bottom: 0;
}

.mm-submission-year small {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.25;
  opacity: .7;
}

.mm-submission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 16px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(232, 224, 205, .08);
}

.mm-submission-row:last-child {
  border-bottom: 0;
}

.mm-submission-title > a,
.mm-submission-title > span {
  font-size: 16px;
  font-weight: 700;
}

.mm-profile-message {
  width: min(720px, calc(100% - 48px));
  min-height: 55vh;
  margin: 0 auto;
  padding: 100px 0;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--mm-fell);
  font-size: 20px;
  font-style: italic;
}

.mm-profile-message h1 {
  font-style: normal;
}

.mm-profile-message .mm-button {
  margin-top: 18px;
  font-style: normal;
}

.mm-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: var(--mm-bg-footer);
  font-size: 13.5px;
}

.mm-profile-footer span {
  opacity: .75;
}

.mm-profile-footer a {
  font-family: var(--mm-display);
  font-size: 12px;
  letter-spacing: .1em;
}

@media (max-width: 900px) {
  .mm-profile-shell {
    width: min(100% - 40px, 720px);
  }

  .mm-profile-hero,
  .mm-profile-columns {
    grid-template-columns: 1fr;
  }

  .mm-profile-stats {
    border-top: 1px solid var(--mm-line);
    border-left: 0;
  }
}

@media (max-width: 600px) {
  .mm-profile-shell {
    width: min(100% - 24px, 520px);
    padding-top: 18px;
  }

  .mm-profile-identity {
    align-items: flex-start;
    gap: 16px;
    padding: 24px 20px;
  }

  .mm-profile-avatar {
    width: 70px;
    height: 70px;
  }

  .mm-profile-identity h1 {
    font-size: 27px;
  }

  .mm-profile-stats {
    grid-template-columns: 1fr;
  }

  .mm-profile-stat,
  .mm-profile-stat:nth-child(odd),
  .mm-profile-stat:nth-last-child(-n + 2) {
    min-height: 96px;
    border-right: 0;
    border-bottom: 1px solid var(--mm-line);
  }

  .mm-profile-stat:last-child {
    border-bottom: 0;
  }

  .mm-profile-panel {
    padding: 21px 17px;
  }

  .mm-section-heading {
    align-items: flex-start;
  }

  .mm-history-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .mm-history-row .mm-place {
    grid-column: 2;
    text-align: left;
  }

  .mm-submission-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mm-submission-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .mm-submission-row .mm-place {
    text-align: left;
  }

  .mm-profile-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }
}

/* ---- Navigation (rendered by nav.js into shadow DOM; this same
   stylesheet is linked inside the shadow root, where :host applies) ---- */

madness-nav,
:host {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: block;
  background: var(--mm-bg);
}

.mm-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  border-bottom: 1px solid var(--mm-line);
}

.mm-nav-brand {
  font-family: var(--mm-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .14em;
  color: var(--mm-ink);
}

.mm-nav-links {
  display: flex;
  gap: 26px;
  font-family: var(--mm-display);
  font-size: 12.5px;
  letter-spacing: .18em;
  font-weight: 600;
}

.mm-nav-links a {
  color: var(--mm-ink);
  opacity: .8;
}

.mm-nav-links a:hover {
  color: var(--mm-gold-bright);
  opacity: 1;
}

.mm-nav-links a.mm-active {
  color: var(--mm-gold);
  opacity: 1;
}

.mm-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(232, 224, 205, .4);
  color: var(--mm-ink);
  font-family: var(--mm-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .18em;
  padding: 7px 14px;
  cursor: pointer;
}

.mm-nav-toggle:hover {
  border-color: var(--mm-gold-bright);
  color: var(--mm-gold-bright);
}

@media (max-width: 900px) {
  .mm-nav {
    flex-wrap: wrap;
    padding: 12px 20px;
    gap: 10px;
  }

  .mm-nav-toggle {
    display: block;
  }

  .mm-nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .mm-nav.mm-open .mm-nav-links {
    display: flex;
  }

  .mm-nav-links a {
    padding: 12px 2px;
    border-top: 1px solid var(--mm-line);
  }
}

/* ---- Rules ---- */

.mm-rules-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 44px 40px 56px;
}

.mm-rules-callout {
  margin-bottom: 44px;
  padding: 26px 30px;
  border: 1px solid var(--mm-gold);
  background: var(--mm-bg-footer);
  text-align: center;
}

.mm-rules-kicker {
  color: var(--mm-gold);
  font-family: var(--mm-display);
  font-size: 13px;
  letter-spacing: .3em;
}

.mm-rules-callout p {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.6;
  opacity: .85;
  text-wrap: pretty;
}

.mm-rules-section {
  padding: 34px 0 36px;
  border-top: 1px solid var(--mm-line);
}

.mm-rules-section-last {
  border-bottom: 1px solid var(--mm-line);
}

.mm-rules-section h2 {
  margin: 0 0 21px;
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 20px;
  letter-spacing: .06em;
  line-height: 1.35;
}

.mm-rules-section h2 span {
  display: inline-block;
  min-width: 31px;
  color: #d63384;
}

.mm-rules-section p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.7;
  opacity: .88;
  text-wrap: pretty;
}

.mm-rules-section p:last-child {
  margin-bottom: 0;
}

.mm-rules-note {
  margin-top: 24px;
  padding: 19px 22px;
  border-left: 3px solid #3fbfb0;
  background: #181614;
  font-size: 16px;
  line-height: 1.6;
}

.mm-rules-scorecard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.mm-rules-scorecard li {
  display: flex;
  min-height: 98px;
  flex-direction: column;
  gap: 7px;
  padding: 19px 21px;
  border: 1px solid var(--mm-line);
  background: #1a1715;
  font-size: 15.5px;
  line-height: 1.45;
}

.mm-rules-scorecard strong {
  color: var(--mm-gold-bright);
  font-family: var(--mm-display);
  font-size: 14px;
  letter-spacing: .04em;
}

.mm-rules-scorecard span {
  opacity: .78;
}

@media (max-width: 600px) {
  .mm-rules-main {
    padding: 30px 20px 42px;
  }

  .mm-rules-callout {
    margin-bottom: 30px;
    padding: 22px 19px;
  }

  .mm-rules-kicker {
    letter-spacing: .2em;
  }

  .mm-rules-section {
    padding: 28px 0 30px;
  }

  .mm-rules-section h2 {
    font-size: 18px;
  }

  .mm-rules-scorecard {
    grid-template-columns: 1fr;
  }

  .mm-rules-scorecard li {
    min-height: 0;
  }
}
